[pypy-commit] pypy array-overallocation-in-nursery: Test and fix

arigo noreply at buildbot.pypy.org
Sun Nov 3 10:49:23 CET 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: array-overallocation-in-nursery
Changeset: r67808:2be7515d790c
Date: 2013-11-03 10:48 +0100
http://bitbucket.org/pypy/pypy/changeset/2be7515d790c/

Log:	Test and fix

diff --git a/rpython/translator/simplify.py b/rpython/translator/simplify.py
--- a/rpython/translator/simplify.py
+++ b/rpython/translator/simplify.py
@@ -847,7 +847,7 @@
                     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:
diff --git a/rpython/translator/test/test_simplify.py b/rpython/translator/test/test_simplify.py
--- a/rpython/translator/test/test_simplify.py
+++ b/rpython/translator/test/test_simplify.py
@@ -337,6 +337,18 @@
         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)]


More information about the pypy-commit mailing list