Skip to content

Commit

Permalink
Merge pull request #1754 from jranieri-grammatech/jranieri/moffset_disp
Browse files Browse the repository at this point in the history
Fix the displacement offset for moffset-encoded operands
  • Loading branch information
kabeor committed Nov 10, 2021
2 parents 7ae0770 + cd66cb2 commit c7538d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/X86/X86DisassemblerDecoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,15 @@ static int readOperands(struct InternalInstruction* insn)
case ENCODING_Ia:
if (readImmediate(insn, insn->addressSize))
return -1;
/* Direct memory-offset (moffset) immediate will get mapped
to memory operand later. We want the encoding info to
reflect that as well. */
insn->displacementOffset = insn->immediateOffset;
insn->consumedDisplacement = true;
insn->displacementSize = insn->immediateSize;
insn->displacement = insn->immediates[insn->numImmediatesConsumed - 1];
insn->immediateOffset = 0;
insn->immediateSize = 0;
break;

case ENCODING_IRC:
Expand Down

0 comments on commit c7538d4

Please sign in to comment.