llvm.org GIT mirror llvm / 863f846
Made the MC disassembler check before accessing MCInst operands for ARM. This allows it to be more tolerant of malformed MCInsts or incorrect instruction metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129840 91177308-0d34-0410-b5e6-96231b3b80d8 Sean Callanan 9 years ago
1 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
197197 default:
198198 return -1;
199199 case kOperandTypeImmediate:
200 if (!Inst.Inst->getOperand(MCOpIndex).isImm())
201 return -1;
202
200203 result = Inst.Inst->getOperand(MCOpIndex).getImm();
201204 return 0;
202205 case kOperandTypeRegister:
203206 {
207 if (!Inst.Inst->getOperand(MCOpIndex).isReg())
208 return -1;
209
204210 unsigned reg = Inst.Inst->getOperand(MCOpIndex).getReg();
205211 return callback(&result, reg, arg);
206212 }
207213 case kOperandTypeARMBranchTarget:
208214 {
215 if (!Inst.Inst->getOperand(MCOpIndex).isImm())
216 return -1;
217
209218 int64_t displacement = Inst.Inst->getOperand(MCOpIndex).getImm();
210219
211220 uint64_t pcVal;