From 8333a8aea3a42490eba818cf31791c96f3c999ce Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 22 Aug 2009 09:28:33 +0000 Subject: llvm-mc: Hopefully fix Mach-O tests on big-endian platforms, force values to be converted to Python ints if possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79736 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Scripts/macho-dump | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/Scripts') diff --git a/test/Scripts/macho-dump b/test/Scripts/macho-dump index d37b545b2a..c41482c6eb 100755 --- a/test/Scripts/macho-dump +++ b/test/Scripts/macho-dump @@ -37,7 +37,10 @@ class Reader: return struct.unpack('><'[self.isLSB] + 'H', self.read(2))[0] 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 registerStringTable(self, strings): if self.string_table is not None: -- cgit v1.2.3