* c-lex.c [! NO_IMPLICIT_EXTERN_C] (cb_enter_file): Check
authorHans-Peter Nilsson <hp@axis.com>
Fri, 10 Nov 2000 05:26:10 +0000 (05:26 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 10 Nov 2000 05:26:10 +0000 (22:26 -0700)
        in_system_header and flags[1] before dereferencing flags[2].

From-SVN: r37361

gcc/ChangeLog
gcc/c-lex.c

index 15ccecb..8b66f22 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-09  Hans-Peter Nilsson  <hp@axis.com>
+
+       * c-lex.c [! NO_IMPLICIT_EXTERN_C] (cb_enter_file): Check
+       in_system_header and flags[1] before dereferencing flags[2].
+
 2000-11-09  Matthew Hiller <hiller@redhat.com>
 
        * reload1.c (reload_combine): Fixed calculation of
index 42b8c39..5117057 100644 (file)
@@ -714,7 +714,7 @@ cb_enter_file (pfile)
 #ifndef NO_IMPLICIT_EXTERN_C
   if (c_header_level)
     ++c_header_level;
-  else if (flags[2] != 0)
+  else if (in_system_header && flags[1] != 0 && flags[2] != 0)
     {
       c_header_level = 1;
       ++pending_lang_change;