aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-19 19:40:40 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-19 19:40:40 +0000
commitc1cf1586f7bbdf8a955a3be79309834ebc25c3af (patch)
tree13552922c4c96bf1b334af1eb144b499c84fe7a3 /lib/Frontend/ASTUnit.cpp
parent295a637416d4bddf5b3d766d9f630a0028596176 (diff)
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!). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111550 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp4
1 files changed, 4 insertions, 0 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;
}
}
}