c-typeck.c (lookup_field): Check if a TYPE_LANG_SPECIFIC pointer field is set before...
authorZiemowit Laski <zlaski@apple.com>
Fri, 10 Dec 2004 21:08:22 +0000 (21:08 +0000)
committerZiemowit Laski <zlaski@gcc.gnu.org>
Fri, 10 Dec 2004 21:08:22 +0000 (21:08 +0000)
[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

gcc/ChangeLog
gcc/c-typeck.c

index 6df6bfbab00f42b542ffbc54df29981c62ac2718..ca808b765391e41f7338deec9115cc443acb20ae 100644 (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
index e5c8ef5234e4c12fab05dfffec156aa8b47d4223..b3f1872758539f7509fe44e747be215acb6c1f70 100644 (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];