[pypy-svn] r57950 - pypy/branch/tuple-nonresizable-395/pypy/objspace/std

fijal at codespeak.net fijal at codespeak.net
Sun Sep 7 16:31:35 CEST 2008


Author: fijal
Date: Sun Sep  7 16:31:33 2008
New Revision: 57950

Modified:
   pypy/branch/tuple-nonresizable-395/pypy/objspace/std/objspace.py
   pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupleobject.py
Log:
A checks for non-resizable list


Modified: pypy/branch/tuple-nonresizable-395/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/objspace/std/objspace.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/objspace/std/objspace.py	Sun Sep  7 16:31:33 2008
@@ -8,6 +8,7 @@
 from pypy.interpreter.pyopcode import unrolling_compare_dispatch_table, \
      BytecodeCorruption
 from pypy.rlib.objectmodel import instantiate
+from pypy.rlib.debug import make_sure_not_resized
 from pypy.interpreter.gateway import PyPyCacheDir
 from pypy.tool.cache import Cache 
 from pypy.tool.sourcetools import func_with_new_name
@@ -563,6 +564,7 @@
     def newtuple(self, list_w):
         from pypy.objspace.std.tupletype import wraptuple
         assert isinstance(list_w, list)
+        make_sure_not_resized(list_w)
         return wraptuple(self, list_w)
 
     def newlist(self, list_w):

Modified: pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupleobject.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupleobject.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupleobject.py	Sun Sep  7 16:31:33 2008
@@ -3,11 +3,14 @@
 from pypy.rlib.rarithmetic import intmask
 from pypy.objspace.std.sliceobject import W_SliceObject
 from pypy.interpreter import gateway
+from pypy.rlib.debug import make_sure_not_resized
+from pypy.annotation import model as annmodel
 
 class W_TupleObject(W_Object):
     from pypy.objspace.std.tupletype import tuple_typedef as typedef
     
     def __init__(w_self, wrappeditems):
+        make_sure_not_resized(wrappeditems)
         w_self.wrappeditems = wrappeditems   # a list of wrapped values
 
     def __repr__(w_self):



More information about the Pypy-commit mailing list