[llvm-commits] [llvm] r130330 - /llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp

Kevin Enderby enderby at apple.com
Wed Apr 27 14:02:27 PDT 2011


Author: enderby
Date: Wed Apr 27 16:02:27 2011
New Revision: 130330

URL: http://llvm.org/viewvc/llvm-project?rev=130330&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp

Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp?rev=130330&r1=130329&r2=130330&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Wed Apr 27 16:02:27 2011
@@ -3800,8 +3800,12 @@
       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)));





More information about the llvm-commits mailing list