Author: Armin Rigo <[email protected]>
Branch: cffi-1.0
Changeset: r1791:d04c328c3d75
Date: 2015-04-24 11:54 +0200
http://bitbucket.org/cffi/cffi/changeset/d04c328c3d75/
Log: hg merge default
diff --git a/cffi/vengine_gen.py b/cffi/vengine_gen.py
--- a/cffi/vengine_gen.py
+++ b/cffi/vengine_gen.py
@@ -190,6 +190,10 @@
indirect_args.append(typ)
indirect_result = tp.result
if isinstance(indirect_result, model.StructOrUnion):
+ if indirect_result.fldtypes is None:
+ raise TypeError("'%s' is used as result type, "
+ "but is opaque" % (
+ indirect_result._get_c_name(),))
indirect_result = model.PointerType(indirect_result)
indirect_args.insert(0, indirect_result)
indirections.insert(0, ("result", indirect_result))
diff --git a/testing/test_verify.py b/testing/test_verify.py
--- a/testing/test_verify.py
+++ b/testing/test_verify.py
@@ -1680,9 +1680,8 @@
e = py.test.raises(TypeError, ffi.verify,
"typedef struct { int x; } foo_t; "
"foo_t myfunc(void) { foo_t x = { 42 }; return x; }")
- assert str(e.value) in [
- "function myfunc: 'foo_t' is used as result type, but is opaque",
- "function myfunc: result type 'foo_t' is opaque"]
+ assert str(e.value) == (
+ "function myfunc: 'foo_t' is used as result type, but is opaque")
def test_include():
ffi1 = FFI()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit