[pypy-svn] r42020 - pypy/dist/pypy/rpython/ootypesystem
antocuni at codespeak.net
antocuni at codespeak.net
Fri Apr 13 11:32:29 CEST 2007
Author: antocuni
Date: Fri Apr 13 11:32:28 2007
New Revision: 42020
Modified:
pypy/dist/pypy/rpython/ootypesystem/ootype.py
pypy/dist/pypy/rpython/ootypesystem/rstr.py
Log:
(antocuni, fijal)
make 'x' * -3 works for ootype backend too.
Modified: pypy/dist/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/ootype.py (original)
+++ pypy/dist/pypy/rpython/ootypesystem/ootype.py Fri Apr 13 11:32:28 2007
@@ -1118,6 +1118,7 @@
def ll_allocate(self, n):
assert isinstance(n, int)
+ assert n >= 0
# do nothing
def ll_append_char(self, ch):
Modified: pypy/dist/pypy/rpython/ootypesystem/rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rstr.py (original)
+++ pypy/dist/pypy/rpython/ootypesystem/rstr.py Fri Apr 13 11:32:28 2007
@@ -71,6 +71,8 @@
return ootype.oohash(s)
def ll_char_mul(ch, times):
+ if times < 0:
+ times = 0
buf = ootype.new(ootype.StringBuilder)
buf.ll_allocate(times)
i = 0
More information about the pypy-svn
mailing list