mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 03:24:49 +00:00
WIP: Add asserts for segment overrides
This commit is contained in:
parent
addadb2a2d
commit
483ce75769
1 changed files with 3 additions and 0 deletions
|
@ -815,6 +815,7 @@ auto TranslateCode(u08* runtime_address, u64 context_base) -> PS4_SYSV_ABI u64 (
|
|||
bool UsesFlags = false;
|
||||
|
||||
if (instruction.info.meta.branch_type != ZYDIS_BRANCH_TYPE_NONE) {
|
||||
assert((instruction.info.attributes & (ZYDIS_ATTRIB_HAS_SEGMENT_FS | ZYDIS_ATTRIB_HAS_SEGMENT_GS)) == 0);
|
||||
if (instruction.info.mnemonic == ZYDIS_MNEMONIC_CALL || instruction.info.mnemonic == ZYDIS_MNEMONIC_JMP) {
|
||||
|
||||
if (instruction.info.mnemonic == ZYDIS_MNEMONIC_CALL) {
|
||||
|
@ -957,6 +958,8 @@ auto TranslateCode(u08* runtime_address, u64 context_base) -> PS4_SYSV_ABI u64 (
|
|||
}
|
||||
break;
|
||||
} else {
|
||||
assert((instruction.info.attributes & (ZYDIS_ATTRIB_HAS_SEGMENT_FS | ZYDIS_ATTRIB_HAS_SEGMENT_GS)) == 0);
|
||||
|
||||
for (int i = 0; i < instruction.info.operand_count; i++) {
|
||||
auto operand = &instruction.operands[i];
|
||||
if (operand->type == ZYDIS_OPERAND_TYPE_REGISTER) {
|
||||
|
|
Loading…
Add table
Reference in a new issue