summaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2019-03-11 10:19:06 +0100
committerArmin Rigo <arigo@tunes.org>2019-03-11 10:19:06 +0100
commit97d81919801352ff0ccfb0d46e19954e7bda8fda (patch)
tree10655fbd1b1f8b0838aa4775592470c2d172395a /c
parent25a38184a811b31a75398ee44eeb66512d0de794 (diff)
downloadcffi-97d81919801352ff0ccfb0d46e19954e7bda8fda.tar.gz
Add an extra test directly here, for pypy
Diffstat (limited to 'c')
-rw-r--r--c/test_c.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/c/test_c.py b/c/test_c.py
index da5f751..baea989 100644
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3452,6 +3452,15 @@ def test_struct_array_no_length():
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")