summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2018-07-30 21:14:25 +0000
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2018-07-30 21:14:25 +0000
commit0bb8e8918795ba0d403fd89982afd9dba128979b (patch)
treeb52434a9a53cb0a729be5b86934d3a3e6d46d266 /llvm
parentf07c5a0e9c4bde60c8aaf359d1945a9a44b95d80 (diff)
downloadbcm5719-llvm-0bb8e8918795ba0d403fd89982afd9dba128979b.tar.gz
bcm5719-llvm-0bb8e8918795ba0d403fd89982afd9dba128979b.zip
This fixes a crash when a second pass is required for the Codeview Type merging *and* the index points outside of the table (which should lead to an error being printed).
This occurs currently until MS precompiled headers .obj is added (see D45213) Differential Revision: https://reviews.llvm.org/D50006 llvm-svn: 338308
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
index e4f39dd988e..2e29c9d7dfa 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
@@ -226,7 +226,10 @@ bool TypeStreamMerger::remapIndexFallback(TypeIndex &Idx,
if (IsSecondPass && MapPos >= Map.size()) {
// FIXME: Print a more useful error. We can give the current record and the
// index that we think its pointing to.
- LastError = joinErrors(std::move(*LastError), errorCorruptRecord());
+ if (LastError)
+ LastError = joinErrors(std::move(*LastError), errorCorruptRecord());
+ else
+ LastError = errorCorruptRecord();
}
++NumBadIndices;
OpenPOWER on IntegriCloud