[pypy-svn] r70892 - in pypy/trunk/pypy: jit/metainterp jit/metainterp/test rpython

arigo at codespeak.net arigo at codespeak.net
Tue Jan 26 17:01:37 CET 2010


Author: arigo
Date: Tue Jan 26 17:01:36 2010
New Revision: 70892

Modified:
   pypy/trunk/pypy/jit/metainterp/codewriter.py
   pypy/trunk/pypy/jit/metainterp/test/test_basic.py
   pypy/trunk/pypy/rpython/rlist.py
Log:
Fix test_getitem_indexerror.


Modified: pypy/trunk/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/codewriter.py	Tue Jan 26 17:01:36 2010
@@ -1326,7 +1326,7 @@
             if self.handle_list_call(op, oopspec_name, args, TP):
                 return
         if oopspec_name.endswith('_foldable'):
-            opname = 'residual_call_pure'  # XXX not for possibly-raising calls
+            opname = 'residual_call_pure'   # should not raise, either
         else:
             opname = 'residual_call'
 

Modified: pypy/trunk/pypy/jit/metainterp/test/test_basic.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/test_basic.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/test/test_basic.py	Tue Jan 26 17:01:36 2010
@@ -1286,7 +1286,6 @@
         assert res == f(21)
 
     def test_getitem_indexerror(self):
-        py.test.skip("failing test!")
         lst = [10, 4, 9, 16]
         def f(n):
             try:

Modified: pypy/trunk/pypy/rpython/rlist.py
==============================================================================
--- pypy/trunk/pypy/rpython/rlist.py	(original)
+++ pypy/trunk/pypy/rpython/rlist.py	Tue Jan 26 17:01:36 2010
@@ -247,12 +247,14 @@
             spec = dum_nocheck
         v_func = hop.inputconst(Void, spec)
         v_lst, v_index = hop.inputargs(r_lst, Signed)
-        if hop.args_s[0].listdef.listitem.mutated:
+        if hop.args_s[0].listdef.listitem.mutated or checkidx:
             if hop.args_s[1].nonneg:
                 llfn = ll_getitem_nonneg
             else:
                 llfn = ll_getitem
         else:
+            # this is the 'foldable' version, which is not used when
+            # we check for IndexError
             if hop.args_s[1].nonneg:
                 llfn = ll_getitem_foldable_nonneg
             else:



More information about the Pypy-commit mailing list