diff options
author | Armin Rigo <arigo@tunes.org> | 2018-01-17 16:39:48 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2018-01-17 16:39:48 +0100 |
commit | ef9f370a7c33472692beacb61b189f8ce1ea4871 (patch) | |
tree | d2f1375bc40fe534a65ea1f0284cc31da6d71a05 | |
parent | 09f9908fc594900f7975dd7e33701a9d7c9e3a7a (diff) | |
download | cffi-ef9f370a7c33472692beacb61b189f8ce1ea4871.tar.gz |
Issue #356
Fix: missing error return check
-rw-r--r-- | c/realize_c_type.c | 4 |
1 files 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) { |