Skip to content

Commit 81f5f96

Browse files
authored
Prevent the instruction category from being overwritten after a fused call/pop has been recognised (#612)
* Prevent the instruction category from being overwritten after a fused call/pop has been recognised * Move assignment up and remove conditional
1 parent eef338d commit 81f5f96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Arch/X86/Arch.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,8 @@ bool X86Arch::DecodeInstruction(uint64_t address, std::string_view inst_bytes,
10461046
return false;
10471047
}
10481048

1049+
inst.category = CreateCategory(xedd);
1050+
10491051
// Look for instruction fusing opportunities. For now, just `call; pop`.
10501052
const char *is_fused_call_pop = nullptr;
10511053
if (len < inst_bytes.size() &&
@@ -1072,7 +1074,6 @@ bool X86Arch::DecodeInstruction(uint64_t address, std::string_view inst_bytes,
10721074
}
10731075
}
10741076

1075-
inst.category = CreateCategory(xedd);
10761077
inst.next_pc = address + len + extra_len;
10771078

10781079
// Fiddle with the size of the bytes.

0 commit comments

Comments
 (0)