Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r515:2f8dba6f83aa Date: 2012-06-25 23:37 +0200 http://bitbucket.org/cffi/cffi/changeset/2f8dba6f83aa/
Log: Test and fix. diff --git a/c/_ffi_backend.c b/c/_ffi_backend.c --- a/c/_ffi_backend.c +++ b/c/_ffi_backend.c @@ -760,7 +760,8 @@ if (!(ctinit->ct_flags & (CT_POINTER|CT_FUNCTIONPTR|CT_ARRAY))) goto cannot_convert; if (ctinit->ct_itemdescr != ct->ct_itemdescr && - !(ct->ct_itemdescr->ct_flags & CT_CAST_ANYTHING)) + !(ct->ct_itemdescr->ct_flags & CT_CAST_ANYTHING) && + !(ctinit->ct_itemdescr->ct_flags & CT_CAST_ANYTHING)) goto cannot_convert; ptrdata = ((CDataObject *)init)->c_data; diff --git a/c/test_c.py b/c/test_c.py --- a/c/test_c.py +++ b/c/test_c.py @@ -624,6 +624,9 @@ s = newp(BStructPtr, [12, 34, 56, p]) assert s.p4 == p # + s = newp(BStructPtr, [12, 34, 56, cast(BVoidP, 0)]) + assert s.p4 == cast(BVoidP, 0) + # py.test.raises(TypeError, newp, BStructPtr, [12, 34, 56, None]) def test_array_in_struct(): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit