mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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
This commit is contained in:
parent
558692fd0a
commit
863f84648f
@ -198,15 +198,24 @@ int EDOperand::evaluate(uint64_t &result,
|
||||
default:
|
||||
return -1;
|
||||
case kOperandTypeImmediate:
|
||||
if (!Inst.Inst->getOperand(MCOpIndex).isImm())
|
||||
return -1;
|
||||
|
||||
result = Inst.Inst->getOperand(MCOpIndex).getImm();
|
||||
return 0;
|
||||
case kOperandTypeRegister:
|
||||
{
|
||||
if (!Inst.Inst->getOperand(MCOpIndex).isReg())
|
||||
return -1;
|
||||
|
||||
unsigned reg = Inst.Inst->getOperand(MCOpIndex).getReg();
|
||||
return callback(&result, reg, arg);
|
||||
}
|
||||
case kOperandTypeARMBranchTarget:
|
||||
{
|
||||
if (!Inst.Inst->getOperand(MCOpIndex).isImm())
|
||||
return -1;
|
||||
|
||||
int64_t displacement = Inst.Inst->getOperand(MCOpIndex).getImm();
|
||||
|
||||
uint64_t pcVal;
|
||||
|
Loading…
Reference in New Issue
Block a user