mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-09-22 09:18:33 +00:00
Add an unreachable on hitting ud2 instead of getting stuck in an infinite loop (#3257)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Add an unreachable on hitting ud2 instead of getting stuck in an infinite loop * Add [[unlikely]] to get ahead of the inevitable PR review comment
This commit is contained in:
parent
161aa49f37
commit
fddded8d20
1 changed files with 4 additions and 0 deletions
|
@ -753,6 +753,10 @@ static bool PatchesIllegalInstructionHandler(void* context) {
|
||||||
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
|
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
|
||||||
const auto status =
|
const auto status =
|
||||||
Common::Decoder::Instance()->decodeInstruction(instruction, operands, code_address);
|
Common::Decoder::Instance()->decodeInstruction(instruction, operands, code_address);
|
||||||
|
if (ZYAN_SUCCESS(status) && instruction.mnemonic == ZydisMnemonic::ZYDIS_MNEMONIC_UD2)
|
||||||
|
[[unlikely]] {
|
||||||
|
UNREACHABLE_MSG("ud2 at code address {:#x}", (u64)code_address);
|
||||||
|
}
|
||||||
LOG_ERROR(Core, "Failed to patch address {:x} -- mnemonic: {}", (u64)code_address,
|
LOG_ERROR(Core, "Failed to patch address {:x} -- mnemonic: {}", (u64)code_address,
|
||||||
ZYAN_SUCCESS(status) ? ZydisMnemonicGetString(instruction.mnemonic)
|
ZYAN_SUCCESS(status) ? ZydisMnemonicGetString(instruction.mnemonic)
|
||||||
: "Failed to decode");
|
: "Failed to decode");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue