[pypy-svn] r27091 - pypy/dist/pypy/module/marshal
pedronis at codespeak.net
pedronis at codespeak.net
Thu May 11 19:42:14 CEST 2006
Author: pedronis
Date: Thu May 11 19:42:12 2006
New Revision: 27091
Modified:
pypy/dist/pypy/module/marshal/interp_marshal.py
Log:
make annotation happy again.
Modified: pypy/dist/pypy/module/marshal/interp_marshal.py
==============================================================================
--- pypy/dist/pypy/module/marshal/interp_marshal.py (original)
+++ pypy/dist/pypy/module/marshal/interp_marshal.py Thu May 11 19:42:12 2006
@@ -373,10 +373,11 @@
b = ord(s[1])
c = ord(s[2])
d = ord(s[3])
- if d & 0x80:
- self.raise_exc('bad marshal data')
x = a | (b<<8) | (c<<16) | (d<<24)
- return x
+ if x >= 0:
+ return x
+ else:
+ self.raise_exc('bad marshal data')
def get_pascal(self):
lng = ord(self.get1())
@@ -498,7 +499,8 @@
b = ord(self.bufstr[pos+1])
c = ord(self.bufstr[pos+2])
d = ord(self.bufstr[pos+3])
- if d & 0x80:
- self.raise_exc('bad marshal data')
x = a | (b<<8) | (c<<16) | (d<<24)
- return x
+ if x >= 0:
+ return x
+ else:
+ self.raise_exc('bad marshal data')
More information about the Pypy-commit
mailing list