[pypy-svn] pypy default: (agaynor, arigo)
arigo
commits-noreply at bitbucket.org
Wed Feb 2 18:16:25 CET 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r41574:53a482379b4f
Date: 2011-02-02 18:14 +0100
http://bitbucket.org/pypy/pypy/changeset/53a482379b4f/
Log: (agaynor, arigo)
Fix translation by adding asserts in the PositionCookie.
diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -239,13 +239,19 @@
def __init__(self, bigint):
self.start_pos = bigint.ulonglongmask()
bigint = bigint.rshift(r_ulonglong.BITS)
- self.dec_flags = intmask(bigint.uintmask())
+ x = intmask(bigint.uintmask())
+ assert x >= 0
+ self.dec_flags = x
bigint = bigint.rshift(r_uint.BITS)
- self.bytes_to_feed = intmask(bigint.uintmask())
+ x = intmask(bigint.uintmask())
+ assert x >= 0
+ self.bytes_to_feed = x
bigint = bigint.rshift(r_uint.BITS)
- self.chars_to_skip = intmask(bigint.uintmask())
+ x = intmask(bigint.uintmask())
+ assert x >= 0
+ self.chars_to_skip = x
bigint = bigint.rshift(r_uint.BITS)
- self.need_eof = int(bigint.uintmask())
+ self.need_eof = bigint.tobool()
def pack(self):
# The meaning of a tell() cookie is: seek to position, set the
More information about the Pypy-commit
mailing list