Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r73762:c9685aebe8e0
Date: 2014-10-03 16:00 +0200
http://bitbucket.org/pypy/pypy/changeset/c9685aebe8e0/

Log:    Test and fix: give a sane error message

diff --git a/rpython/jit/codewriter/jtransform.py 
b/rpython/jit/codewriter/jtransform.py
--- a/rpython/jit/codewriter/jtransform.py
+++ b/rpython/jit/codewriter/jtransform.py
@@ -798,6 +798,7 @@
         if self.is_typeptr_getset(op):
             # ignore the operation completely -- instead, it's done by 'new'
             return
+        self._check_no_vable_array(op.args)
         # turn the flow graph 'setfield' operation into our own version
         [v_inst, c_fieldname, v_value] = op.args
         RESULT = v_value.concretetype
diff --git a/rpython/jit/codewriter/test/test_flatten.py 
b/rpython/jit/codewriter/test/test_flatten.py
--- a/rpython/jit/codewriter/test/test_flatten.py
+++ b/rpython/jit/codewriter/test/test_flatten.py
@@ -1036,6 +1036,21 @@
                            transform=True)
         assert str(e.value).startswith("A virtualizable array is passed aroun")
 
+    def test_vable_attribute_list_copied_around(self):
+        class F:
+            _virtualizable_ = ['vlist[*]']
+            vlist = None
+            def __init__(self, x):
+                self.vlist = [x]
+        def g():
+            return F(42)
+        def f():
+            f = g()
+            f.extrastuff = f.vlist
+        e = py.test.raises(AssertionError, self.encoding_test, f, [], "!",
+                           transform=True)
+        assert str(e.value).startswith("A virtualizable array is passed aroun")
+
 
 def check_force_cast(FROM, TO, operations, value):
     """Check that the test is correctly written..."""
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to