]> granicus.if.org Git - llvm/commitdiff
Fix crasher in CodeView test.
authorZachary Turner <zturner@google.com>
Fri, 19 May 2017 00:56:39 +0000 (00:56 +0000)
committerZachary Turner <zturner@google.com>
Fri, 19 May 2017 00:56:39 +0000 (00:56 +0000)
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

lib/DebugInfo/CodeView/TypeDumpVisitor.cpp

index 5fb46c5fa396211f5ab4dc0f94bb331f0d778fca..84f52a05581598dd266989d6d3b789d28b53a8fd 100644 (file)
@@ -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();
 }