]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR preprocessor/11361 (ICE (segfault) in c-lex.c with one-liner)
authorPer Bothner <pbothner@apple.com>
Tue, 22 Jul 2003 23:11:34 +0000 (23:11 +0000)
committerPer Bothner <bothner@gcc.gnu.org>
Tue, 22 Jul 2003 23:11:34 +0000 (16:11 -0700)
* line-map.c (add_line_map):  Handle invalid LEAVE request.
Fixes PR preprocessor/11361.

From-SVN: r69688

gcc/ChangeLog
gcc/line-map.c

index 21263c2869400298d898d5aec9dd94a1354e3ff3..5e84184090aba255b907767f1730f5cd937019cc 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-22  Per Bothner  <pbothner@apple.com>
+
+       * line-map.c (add_line_map):  Handle invalid LEAVE request.
+       Fixes PR preprocessor/11361.
+
 2003-07-22  Per Bothner  <pbothner@apple.com>
 
        * diagnostic.c.(diagnostic_report_current_module):  Update to match
index f3c2369dc9cb0fe6920d7f1fb07a36412a2f06f1..50c9c881036dd7da5229a47721f1655fd32d5b7c 100644 (file)
@@ -96,9 +96,15 @@ linemap_add (struct line_maps *set, enum lc_reason reason,
 
       if (MAIN_FILE_P (map - 1))
        {
-         set->depth--;
-         set->used--;
-         return NULL;
+         if (to_file == NULL)
+           {
+             set->depth--;
+             set->used--;
+             return NULL;
+           }
+         error = true;
+          reason = LC_RENAME;
+          from = map - 1;
        }
       else
        {