OSDN Git Service

This fixes a crash when a second pass is required for the Codeview Type merging ...
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Mon, 30 Jul 2018 21:14:25 +0000 (21:14 +0000)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Mon, 30 Jul 2018 21:14:25 +0000 (21:14 +0000)
This occurs currently until MS precompiled headers .obj is added (see D45213)

Differential Revision: https://reviews.llvm.org/D50006

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338308 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/CodeView/TypeStreamMerger.cpp

index e4f39dd..2e29c9d 100644 (file)
@@ -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;