1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

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

llvm-svn: 200100
This commit is contained in:
Craig Topper 2014-01-25 22:48:43 +00:00
parent 48b7167917
commit b459efc246

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) {