From: Zachary Turner Date: Fri, 19 May 2017 00:56:39 +0000 (+0000) Subject: Fix crasher in CodeView test. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=943db67405091b9f29d6aa71add9e897a8f97097;p=llvm Fix crasher in CodeView test. Apparently this was always broken, but previously we were more graceful about it and we would print "unknown udt" if we couldn't find the type index, whereas now we just segfault because we assume it's valid. But this exposed a real bug, which is that we weren't looking in the right place. So fix that, and also fix this crash at the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303397 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp b/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp index 5fb46c5fa39..84f52a05581 100644 --- a/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp +++ b/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp @@ -242,7 +242,7 @@ Error TypeDumpVisitor::visitKnownRecord(CVType &CVR, StringListRecord &Strs) { W->printNumber("NumStrings", Size); ListScope Arguments(*W, "Strings"); for (uint32_t I = 0; I < Size; ++I) { - printTypeIndex("String", Indices[I]); + printItemIndex("String", Indices[I]); } return Error::success(); }