Fix a bug where a 32-bit address with the high bit does not get symbolicated
authorKevin Enderby <enderby@apple.com>
Thu, 18 Oct 2012 21:49:18 +0000 (21:49 +0000)
committerKevin Enderby <enderby@apple.com>
Thu, 18 Oct 2012 21:49:18 +0000 (21:49 +0000)
because the value is incorrectly being signed extended when passed to
SymbolLookUp().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166234 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/Disassembler/ARMDisassembler.cpp

index bf0dabb4a0f23a2be67bf2ced811d88d9ea3ee11..d2b1cc37f212d77b79521f490deec2041dabf734 100644 (file)
@@ -525,8 +525,9 @@ static bool tryAddingSymbolicOperand(uint64_t Address, int32_t Value,
     else
        ReferenceType = LLVMDisassembler_ReferenceType_InOut_None;
     const char *ReferenceName;
-    const char *Name = SymbolLookUp(DisInfo, Value, &ReferenceType, Address,
-                                    &ReferenceName);
+    uint64_t SymbolValue = 0x00000000ffffffffULL & Value;
+    const char *Name = SymbolLookUp(DisInfo, SymbolValue, &ReferenceType,
+                                    Address, &ReferenceName);
     if (Name) {
       SymbolicOp.AddSymbol.Name = Name;
       SymbolicOp.AddSymbol.Present = true;