Commits

Antonio Cuni  committed a0600a4 Merge

merge heads

  • Participants
  • Parent commits f5f1f3a, f6fabf4

Comments (0)

Files changed (1)

File pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py

         jump(p0, p1, p2, i12, p4, descr=<Loop0>)
         """)
 
+    def test_exception_inside_loop_2(self):
+        def main(n):
+            def g(n):
+                raise ValueError(n)  # ID: raise
+            def f(n):
+                g(n)
+            #
+            while n:
+                try:
+                    f(n)
+                except ValueError:
+                    pass
+                n -= 1
+            return n
+        #
+        log = self.run(main, [1000], threshold=400)
+        assert log.result == 0
+        loop, = log.loops_by_filename(self.filepath)
+        ops = log.opnames(loop.ops_by_id('raise'))
+        assert 'new' not in ops
+
     def test_reraise(self):
         def f(n):
             i = 0
         log = self.run(f, [100000])
         assert log.result == 100000
         loop, = log.loops_by_filename(self.filepath)
+        assert loop.match("""
+            i7 = int_lt(i4, i5)
+            guard_true(i7, descr=<Guard3>)
+            --EXC-TICK--
+            i14 = int_add(i4, 1)
+            --TICK--
+            jump(p0, p1, p2, p3, i14, i5, p6, descr=<Loop0>)
+        """)