Author: Philip Jenvey <[email protected]>
Branch:
Changeset: r64644:0289956d46c1
Date: 2013-05-28 14:43 -0700
http://bitbucket.org/pypy/pypy/changeset/0289956d46c1/
Log: merge upstream
diff --git a/rpython/translator/c/test/test_standalone.py
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -830,6 +830,30 @@
out = cbuilder.cmdexec('')
assert out.strip() == '789'
+ def test_llhelper_stored_in_struct(self):
+ from rpython.rtyper.annlowlevel import llhelper
+
+ def f(x):
+ return x + 3
+
+ FUNC_TP = lltype.Ptr(lltype.FuncType([lltype.Signed], lltype.Signed))
+
+ S = lltype.GcStruct('s', ('f', FUNC_TP))
+
+ class Glob(object):
+ pass
+
+ glob = Glob()
+
+ def entry_point(argv):
+ x = llhelper(FUNC_TP, f)
+ s = lltype.malloc(S)
+ s.f = x
+ glob.s = s # escape
+ return 0
+
+ self.compile(entry_point)
+ # assert did not explode
class TestMaemo(TestStandalone):
def setup_class(cls):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit