[pypy-commit] cffi default: Add an extra test directly here, for pypy

arigo pypy.commits at gmail.com
Mon Mar 11 05:18:11 EDT 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r3241:042594ebfddc
Date: 2019-03-11 10:19 +0100
http://bitbucket.org/cffi/cffi/changeset/042594ebfddc/

Log:	Add an extra test directly here, for pypy

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3452,6 +3452,15 @@
     assert p.a[1] == 20
     assert p.a[2] == 30
     assert p.a[3] == 0
+    #
+    # struct of struct of varsized array
+    BStruct2 = new_struct_type("bar")
+    complete_struct_or_union(BStruct2, [('head', BInt),
+                                        ('tail', BStruct)])
+    for i in range(2):   # try to detect heap overwrites
+        p = newp(new_pointer_type(BStruct2), [100, [200, list(range(50))]])
+        assert p.tail.y[49] == 49
+
 
 def test_struct_array_no_length_explicit_position():
     BInt = new_primitive_type("int")


More information about the pypy-commit mailing list