From: Richard Stallman Date: Wed, 15 Jul 1992 18:39:27 +0000 (+0000) Subject: (layout_record): Handle NULL dsize. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0b382b17ae011b19fa2cda8201e2588a910632e;p=gcc.git (layout_record): Handle NULL dsize. From-SVN: r1592 --- diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 7c4ef96b3cf..e2202844ced 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -430,7 +430,12 @@ layout_record (rec) { register tree dsize = DECL_SIZE (field); - if (TREE_CODE (dsize) == INTEGER_CST) + /* This can happen when we have an invalid nested struct definition, + such as struct j { struct j { int i; } }. The error message is + printed in finish_struct. */ + if (dsize == 0) + /* Do nothing. */; + else if (TREE_CODE (dsize) == INTEGER_CST) const_size += TREE_INT_CST_LOW (dsize); else {