summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2019-05-22 12:50:01 +0000
committerIlya Biryukov <ibiryukov@google.com>2019-05-22 12:50:01 +0000
commit2917526f291b6ef4e36193f3f2424826c7c6af20 (patch)
tree3b3379e01f695617ed66e279db002ae07259f90b /clang/lib/Frontend/ASTUnit.cpp
parent9b40dd6318b9e15bac2daa09e7563676d43e6ccf (diff)
downloadbcm5719-llvm-2917526f291b6ef4e36193f3f2424826c7c6af20.tar.gz
bcm5719-llvm-2917526f291b6ef4e36193f3f2424826c7c6af20.zip
[Frontend] Return an error on bad inputs to PrecompiledPreabmle
Summary: Instead of failing with assertions. Fixes a crash found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12865 Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62137 llvm-svn: 361376
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 95d1bf27d7b..c4085b699e0 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1368,6 +1368,7 @@ ASTUnit::getMainBufferWithPrecompiledPreamble(
case BuildPreambleError::CouldntCreateTargetInfo:
case BuildPreambleError::BeginSourceFileFailed:
case BuildPreambleError::CouldntEmitPCH:
+ case BuildPreambleError::BadInputs:
// These erros are more likely to repeat, retry after some period.
PreambleRebuildCountdown = DefaultPreambleRebuildInterval;
return nullptr;
OpenPOWER on IntegriCloud