[llvm] r205581 - Fix llvm-objdump crash.

Rafael Espindola rafael.espindola at gmail.com
Thu Apr 3 16:20:03 PDT 2014


Author: rafael
Date: Thu Apr  3 18:20:02 2014
New Revision: 205581

URL: http://llvm.org/viewvc/llvm-project?rev=205581&view=rev
Log:
Fix llvm-objdump crash.

Modified:
    llvm/trunk/lib/Object/MachOObjectFile.cpp
    llvm/trunk/test/DebugInfo/X86/DW_AT_location-reference.ll

Modified: llvm/trunk/lib/Object/MachOObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOObjectFile.cpp?rev=205581&r1=205580&r2=205581&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/MachOObjectFile.cpp Thu Apr  3 18:20:02 2014
@@ -976,7 +976,7 @@ MachOObjectFile::getRelocationValueStrin
       }
       case MachO::X86_64_RELOC_SUBTRACTOR: {
         DataRefImpl RelNext = Rel;
-        RelNext.d.a++;
+        moveRelocationNext(RelNext);
         MachO::any_relocation_info RENext = getRelocation(RelNext);
 
         // X86_64_RELOC_SUBTRACTOR must be followed by a relocation of type
@@ -1024,7 +1024,7 @@ MachOObjectFile::getRelocationValueStrin
         return object_error::success;
       case MachO::GENERIC_RELOC_SECTDIFF: {
         DataRefImpl RelNext = Rel;
-        RelNext.d.a++;
+        moveRelocationNext(RelNext);
         MachO::any_relocation_info RENext = getRelocation(RelNext);
 
         // X86 sect diff's must be followed by a relocation of type
@@ -1046,7 +1046,7 @@ MachOObjectFile::getRelocationValueStrin
       switch (Type) {
         case MachO::GENERIC_RELOC_LOCAL_SECTDIFF: {
           DataRefImpl RelNext = Rel;
-          RelNext.d.a++;
+          moveRelocationNext(RelNext);
           MachO::any_relocation_info RENext = getRelocation(RelNext);
 
           // X86 sect diff's must be followed by a relocation of type
@@ -1085,7 +1085,7 @@ MachOObjectFile::getRelocationValueStrin
           printRelocationTargetName(this, RE, fmt);
 
           DataRefImpl RelNext = Rel;
-          RelNext.d.a++;
+          moveRelocationNext(RelNext);
           MachO::any_relocation_info RENext = getRelocation(RelNext);
 
           // ARM half relocs must be followed by a relocation of type

Modified: llvm/trunk/test/DebugInfo/X86/DW_AT_location-reference.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/DW_AT_location-reference.ll?rev=205581&r1=205580&r2=205581&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/DW_AT_location-reference.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/DW_AT_location-reference.ll Thu Apr  3 18:20:02 2014
@@ -1,8 +1,6 @@
 ; RUN: llc -O1 -filetype=obj -mtriple=x86_64-apple-darwin < %s > %t
 ; RUN: llvm-dwarfdump %t  | FileCheck %s
-; FIXME: llvm-objdump is failing with an error when parsing some relocations
-; here, though it doesn't seem to adversely affect the test
-; RUN: not llvm-objdump -r %t | FileCheck -check-prefix=DARWIN %s
+; RUN: llvm-objdump -r %t | FileCheck -check-prefix=DARWIN %s
 ; RUN: llc -O1 -filetype=obj -mtriple=x86_64-pc-linux-gnu < %s > %t
 ; RUN: llvm-dwarfdump %t  | FileCheck %s
 ; RUN: llvm-objdump -r %t | FileCheck -check-prefix=LINUX %s





More information about the llvm-commits mailing list