llvm.org GIT mirror llvm / badf4cb
[X86] Check return value of readSIB in disassembler so errors propagate. In particular this makes a too short instruction with a missing SIB byte fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204305 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 5 years ago
1 changed file(s) with 2 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
10911091 case 2:
10921092 dbgprintf(insn, "SIB-based addressing doesn't work in 16-bit mode");
10931093 return -1;
1094 break;
10951094 case 4:
10961095 sibIndexBase = SIB_INDEX_EAX;
10971096 sibBaseBase = SIB_BASE_EAX;
13131312 case 0xc: /* in case REXW.b is set */
13141313 insn->eaBase = (insn->addressSize == 4 ?
13151314 EA_BASE_sib : EA_BASE_sib64);
1316 readSIB(insn);
1317 if (readDisplacement(insn))
1315 if (readSIB(insn) || readDisplacement(insn))
13181316 return -1;
13191317 break;
13201318 case 0x5:
13381336 case 0x4:
13391337 case 0xc: /* in case REXW.b is set */
13401338 insn->eaBase = EA_BASE_sib;
1341 readSIB(insn);
1342 if (readDisplacement(insn))
1339 if (readSIB(insn) || readDisplacement(insn))
13431340 return -1;
13441341 break;
13451342 default: