Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2664:129bed02b1c3
Date: 2016-04-17 09:54 +0200
http://bitbucket.org/cffi/cffi/changeset/129bed02b1c3/
Log: Oops. In this case, unpack(p) returns a list of <cdata struct> that
are each inside 'p'. So 'p' must be kept alive
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3584,7 +3584,8 @@
assert str(e.value) == "'foo *' points to items of unknown size"
complete_struct_or_union(BStruct, [('a1', BInt, -1),
('a2', BInt, -1)])
- lst = unpack(newp(new_array_type(BStructPtr, None), [[4,5], [6,7]]), 2)
+ array_of_structs = newp(new_array_type(BStructPtr, None), [[4,5], [6,7]])
+ lst = unpack(array_of_structs, 2)
assert typeof(lst[0]) is BStruct
assert lst[0].a1 == 4 and lst[1].a2 == 7
#
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit