diff options
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 4 | ||||
-rw-r--r-- | test/Index/Inputs/crash-recovery-reparse-remap.c | 8 | ||||
-rw-r--r-- | test/Index/crash-recovery-reparse.c | 14 |
3 files changed, 17 insertions, 9 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 523b8d0a6c..4395246f49 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -850,6 +850,8 @@ ASTUnit::ComputePreamble(CompilerInvocation &Invocation, // 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 @@ ASTUnit::ComputePreamble(CompilerInvocation &Invocation, // Remove this remapping. We've captured the buffer already. M = PreprocessorOpts.eraseRemappedFile(M); E = PreprocessorOpts.remapped_file_buffer_end(); + if (M == E) + break; } } } diff --git a/test/Index/Inputs/crash-recovery-reparse-remap.c b/test/Index/Inputs/crash-recovery-reparse-remap.c index 8a7707a590..0357dbe748 100644 --- a/test/Index/Inputs/crash-recovery-reparse-remap.c +++ b/test/Index/Inputs/crash-recovery-reparse-remap.c @@ -1,3 +1,11 @@ + #warning parsing remapped file + + +int x; + #pragma clang __debug crash + +int x; + diff --git a/test/Index/crash-recovery-reparse.c b/test/Index/crash-recovery-reparse.c index 90ce25d1ad..0697576880 100644 --- a/test/Index/crash-recovery-reparse.c +++ b/test/Index/crash-recovery-reparse.c @@ -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 |