Fix a bug in the case that there is no add or subtract symbol and the offset

value is zero so it does not add a NULL expr operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130330 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kevin Enderby 2011-04-27 21:02:27 +00:00
parent 1d7e818a38
commit e23aea28f9

View File

@ -3800,8 +3800,12 @@ bool ARMBasicMCBuilder::tryAddingSymbolicOperand(uint64_t Value,
Expr = MCBinaryExpr::CreateAdd(Add, Off, *Ctx);
else
Expr = Add;
} else
Expr = Off;
} else {
if (Off != 0)
Expr = Off;
else
Expr = MCConstantExpr::Create(0, *Ctx);
}
if (SymbolicOp.VariantKind == LLVMDisassembler_VariantKind_ARM_HI16)
MI.addOperand(MCOperand::CreateExpr(ARMMCExpr::CreateUpper16(Expr, *Ctx)));