diff options
Diffstat (limited to 'ext/ffi_c/libffi/src/debug.c')
-rw-r--r-- | ext/ffi_c/libffi/src/debug.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/ffi_c/libffi/src/debug.c b/ext/ffi_c/libffi/src/debug.c index 51dcfcf..f3172b1 100644 --- a/ext/ffi_c/libffi/src/debug.c +++ b/ext/ffi_c/libffi/src/debug.c @@ -54,6 +54,11 @@ void ffi_type_test(ffi_type *a, char *file, int line) FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line); FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line); FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line); - FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line); + FFI_ASSERT_AT((a->type != FFI_TYPE_STRUCT && a->type != FFI_TYPE_COMPLEX) + || a->elements != NULL, file, line); + FFI_ASSERT_AT(a->type != FFI_TYPE_COMPLEX + || (a->elements != NULL + && a->elements[0] != NULL && a->elements[1] == NULL), + file, line); } |