Set displacementSize to 1 for instrucitons with mod==0x1. Fixes PR17310. Modified from patch by James Courtier-Dutton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200100 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2014-01-25 22:48:43 +00:00
parent 1299df2a0b
commit c45addd6e4

View File

@ -1311,6 +1311,7 @@ static int readModRM(struct InternalInstruction* insn) {
case 0x1:
insn->eaBase = (EABase)(insn->eaBaseBase + rm);
insn->eaDisplacement = EA_DISP_8;
insn->displacementSize = 1;
if (readDisplacement(insn))
return -1;
break;
@ -1356,6 +1357,8 @@ static int readModRM(struct InternalInstruction* insn) {
}
break;
case 0x1:
insn->displacementSize = 1;
// FALLTHROUGH
case 0x2:
insn->eaDisplacement = (mod == 0x1 ? EA_DISP_8 : EA_DISP_32);
switch (rm) {