Commits

Armin Rigo committed f0986e9

Fix test_getitem_indexerror.

  • Participants
  • Parent commits e392586

Comments (0)

Files changed (3)

File pypy/jit/metainterp/codewriter.py

             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'
 

File pypy/jit/metainterp/test/test_basic.py

         assert res == f(21)
 
     def test_getitem_indexerror(self):
-        py.test.skip("failing test!")
         lst = [10, 4, 9, 16]
         def f(n):
             try:

File pypy/rpython/rlist.py

             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: