c-typeck.c (lookup_field): Check if a TYPE_LANG_SPECIFIC pointer field is set before dereferencing it.

[gcc/ChangeLog]
2004-12-10  Ziemowit Laski  <zlaski@apple.com>

        * c-typeck.c (lookup_field): Check if a TYPE_LANG_SPECIFIC
        pointer field is set before dereferencing it.

From-SVN: r92007
This commit is contained in:
Ziemowit Laski 2004-12-10 21:08:22 +00:00 committed by Ziemowit Laski
parent ef0b4f287a
commit 22a0b85fcc
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-12-10 Ziemowit Laski <zlaski@apple.com>
* c-typeck.c (lookup_field): Check if a TYPE_LANG_SPECIFIC
pointer field is set before dereferencing it.
2004-12-10 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/18903

View File

@ -1377,7 +1377,7 @@ lookup_field (tree decl, tree component)
find the element. Otherwise, do a linear search. TYPE_LANG_SPECIFIC
will always be set for structures which have many elements. */
if (TYPE_LANG_SPECIFIC (type))
if (TYPE_LANG_SPECIFIC (type) && TYPE_LANG_SPECIFIC (type)->s)
{
int bot, top, half;
tree *field_array = &TYPE_LANG_SPECIFIC (type)->s->elts[0];