Commits

Armin Rigo committed 2be7515

Test and fix

Comments (0)

Files changed (2)

rpython/translator/simplify.py

                     self.fixed_list[p] = item
                 else:
                     self.fallback_list.append(item)
-            append._always_inline_ = True
+            append._always_inline_ = "force"
 
             def fence_exact(self):
                 if self.optimize:

rpython/translator/test/test_simplify.py

         res = interp.eval_graph(graph, [10])
         assert res == 5
 
+    def test_simple_except(self):
+        def main(n):
+            try:
+                lst = [chr(x) for x in range(n)]
+            except:
+                return -1
+            lst[0] = "foobar"
+            return ord(lst[5][0])
+        interp, graph = self.specialize(main, [int])
+        res = interp.eval_graph(graph, [10])
+        assert res == 5
+
     def test_mutated_after_listcomp(self):
         def main(n):
             lst = [x*17 for x in range(n)]