converted to Python ints if possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79736
91177308-0d34-0410-b5e6-
96231b3b80d8
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: