[llvm-branch-commits] [llvm-branch] r79810 - /llvm/branches/release_26/test/Scripts/macho-dump

Tanya Lattner tonic at nondot.org
Sat Aug 22 20:07:49 PDT 2009


Author: tbrethou
Date: Sat Aug 22 22:07:48 2009
New Revision: 79810

URL: http://llvm.org/viewvc/llvm-project?rev=79810&view=rev
Log:
Merge 79736 from mainline.
llvm-mc: Hopefully fix Mach-O tests on big-endian platforms, force values to be
converted to Python ints if possible.

Modified:
    llvm/branches/release_26/test/Scripts/macho-dump

Modified: llvm/branches/release_26/test/Scripts/macho-dump
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/test/Scripts/macho-dump?rev=79810&r1=79809&r2=79810&view=diff

==============================================================================
--- llvm/branches/release_26/test/Scripts/macho-dump (original)
+++ llvm/branches/release_26/test/Scripts/macho-dump Sat Aug 22 22:07:48 2009
@@ -26,7 +26,10 @@
       return data
 
    def read32(self):
-      return struct.unpack('><'[self.isLSB] + 'I', self.read(4))[0]
+      # Force to 32-bit, if possible; otherwise these might be long ints on a
+      # big-endian platform. FIXME: Why???
+      Value = struct.unpack('><'[self.isLSB] + 'I', self.read(4))[0]
+      return int(Value)
 
 def dumpmacho(path, opts):
    f = Reader(path)





More information about the llvm-branch-commits mailing list