summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ffi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ffi.c b/ffi.c
index 42a16db0..255a318d 100644
--- a/ffi.c
+++ b/ffi.c
@@ -3029,7 +3029,11 @@ val ffi_typedef(val name, val type)
val ffi_size(val type)
{
+ val self = lit("ffi-size");
struct txr_ffi_type *tft = ffi_type_struct_checked(type);
+ if (tft->size == 0 && bitfield_syntax_p(tft->syntax))
+ uw_throwf(error_s, lit("~a: bitfield type ~s has no size"),
+ self, type, nao);
return num(tft->size);
}