summaryrefslogtreecommitdiffstats
path: root/clang/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
commit438c7724f9d549b855d1fbdf857c5d9d5b2ffe7d (patch)
treeb719548d29c2f3d576556082f267c58c7655158a /clang/lib/Frontend/ASTUnit.cpp
parentcbbc430d241872fdce4dd014d68f2527a8a6af81 (diff)
downloadbcm5719-llvm-438c7724f9d549b855d1fbdf857c5d9d5b2ffe7d.tar.gz
bcm5719-llvm-438c7724f9d549b855d1fbdf857c5d9d5b2ffe7d.zip
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!). llvm-svn: 111550
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 523b8d0a6c2..4395246f493 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/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;
}
}
}
OpenPOWER on IntegriCloud