[cfe-commits] r111550 - in /cfe/trunk: lib/Frontend/ASTUnit.cpp test/Index/Inputs/crash-recovery-reparse-remap.c test/Index/crash-recovery-reparse.c

Daniel Dunbar daniel at zuster.org
Thu Aug 19 12:40:40 PDT 2010


Author: ddunbar
Date: Thu Aug 19 14:40:40 2010
New Revision: 111550

URL: http://llvm.org/viewvc/llvm-project?rev=111550&view=rev
Log:
Fix a loop overrun in ComputePreamble when the last remapped file was erased,
and reenable crash recovery test.
 - Reparsing is still very crashy / weird, so I had to sprinkle random code into
   the remapped input to get it to do what I want (i.e., crash!).

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp
    cfe/trunk/test/Index/Inputs/crash-recovery-reparse-remap.c
    cfe/trunk/test/Index/crash-recovery-reparse.c

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=111550&r1=111549&r2=111550&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Thu Aug 19 14:40:40 2010
@@ -850,6 +850,8 @@
           // Remove this remapping. We've captured the buffer already.
           M = PreprocessorOpts.eraseRemappedFile(M);
           E = PreprocessorOpts.remapped_file_end();
+          if (M == E)
+            break;
         }
       }
     }
@@ -875,6 +877,8 @@
           // Remove this remapping. We've captured the buffer already.
           M = PreprocessorOpts.eraseRemappedFile(M);
           E = PreprocessorOpts.remapped_file_buffer_end();
+          if (M == E)
+            break;
         }
       }
     }

Modified: cfe/trunk/test/Index/Inputs/crash-recovery-reparse-remap.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Inputs/crash-recovery-reparse-remap.c?rev=111550&r1=111549&r2=111550&view=diff
==============================================================================
--- cfe/trunk/test/Index/Inputs/crash-recovery-reparse-remap.c (original)
+++ cfe/trunk/test/Index/Inputs/crash-recovery-reparse-remap.c Thu Aug 19 14:40:40 2010
@@ -1,3 +1,11 @@
+
 #warning parsing remapped file
 
+
+
+int x;
+
 #pragma clang __debug crash
+
+int x;
+

Modified: cfe/trunk/test/Index/crash-recovery-reparse.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/crash-recovery-reparse.c?rev=111550&r1=111549&r2=111550&view=diff
==============================================================================
--- cfe/trunk/test/Index/crash-recovery-reparse.c (original)
+++ cfe/trunk/test/Index/crash-recovery-reparse.c Thu Aug 19 14:40:40 2010
@@ -1,12 +1,8 @@
-// Disabled, pending investigation.
-// RUN: false
-// XFAIL: *
-//
-// RUNX: env CINDEXTEST_EDITING=1 \
-// RUNX:   not c-index-test -test-load-source-reparse 1 local \
-// RUNX:   -remap-file="%s;%S/Inputs/crash-recovery-reparse-remap.c" \
-// RUNX:   %s 2> %t.err
-// RUNX: FileCheck < %t.err -check-prefix=CHECK-REPARSE-SOURCE-CRASH %s
+// RUN: env CINDEXTEST_EDITING=1 \
+// RUN:   not c-index-test -test-load-source-reparse 1 local \
+// RUN:   -remap-file="%s;%S/Inputs/crash-recovery-reparse-remap.c" \
+// RUN:   %s 2> %t.err
+// RUN: FileCheck < %t.err -check-prefix=CHECK-REPARSE-SOURCE-CRASH %s
 // CHECK-REPARSE-SOURCE-CRASH: Unable to reparse translation unit
 //
 // XFAIL: win32





More information about the cfe-commits mailing list