Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r3089:e8b85a3539f2
Date: 2018-01-17 16:39 +0100
http://bitbucket.org/cffi/cffi/changeset/e8b85a3539f2/

Log:    Issue #356

        Fix: missing error return check

diff --git a/c/realize_c_type.c b/c/realize_c_type.c
--- a/c/realize_c_type.c
+++ b/c/realize_c_type.c
@@ -737,13 +737,13 @@
                 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) {
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to