Skip to content

Commit

Permalink
Prevent the instruction category from being overwritten after a fused…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
tetsuo-cpp authored Jul 28, 2022
1 parent eef338d commit 81f5f96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Arch/X86/Arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,8 @@ bool X86Arch::DecodeInstruction(uint64_t address, std::string_view inst_bytes,
return false;
}

inst.category = CreateCategory(xedd);

// Look for instruction fusing opportunities. For now, just `call; pop`.
const char *is_fused_call_pop = nullptr;
if (len < inst_bytes.size() &&
Expand All @@ -1072,7 +1074,6 @@ bool X86Arch::DecodeInstruction(uint64_t address, std::string_view inst_bytes,
}
}

inst.category = CreateCategory(xedd);
inst.next_pc = address + len + extra_len;

// Fiddle with the size of the bytes.
Expand Down

0 comments on commit 81f5f96

Please sign in to comment.