From ef9f370a7c33472692beacb61b189f8ce1ea4871 Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Wed, 17 Jan 2018 16:39:48 +0100 Subject: Issue #356 Fix: missing error return check --- c/realize_c_type.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/realize_c_type.c b/c/realize_c_type.c index 9c21286..082c488 100644 --- a/c/realize_c_type.c +++ b/c/realize_c_type.c @@ -737,13 +737,13 @@ static int do_realize_lazy_struct(CTypeDescrObject *ct) return -1; } - if (fld->field_offset == (size_t)-1) { + if (ctf != NULL && fld->field_offset == (size_t)-1) { /* unnamed struct, with field positions and sizes entirely determined by complete_struct_or_union() and not checked. Or, bitfields (field_size >= 0), similarly not checked. */ assert(fld->field_size == (size_t)-1 || fbitsize >= 0); } - else if (detect_custom_layout(ct, SF_STD_FIELD_POS, + else if (ctf == NULL || detect_custom_layout(ct, SF_STD_FIELD_POS, ctf->ct_size, fld->field_size, "wrong size for field '", fld->name, "'") < 0) { -- cgit v1.2.1