]> granicus.if.org Git - llvm/commitdiff
DebugInfo: Shot in the dark attempt to fix ubsan error from r374122
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 9 Oct 2019 18:37:13 +0000 (18:37 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 9 Oct 2019 18:37:13 +0000 (18:37 +0000)
(specifying an underlying type for the enum might also be suitable - but
this seems better/as good, since there's a clear expectation this can
contain values other than the actual enumerators of this enum)

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

lib/DebugInfo/DWARF/DWARFDebugLoc.cpp

index a5f79f86852ff2be23b5c57f763427991b657264..a243ed3a80beab30bf08c6a5a990c459d75b8de5 100644 (file)
@@ -143,7 +143,7 @@ DWARFDebugLoclists::parseOneLocationList(const DataExtractor &Data,
   DataExtractor::Cursor C(*Offset);
 
   // dwarf::DW_LLE_end_of_list_entry is 0 and indicates the end of the list.
-  while (auto Kind = static_cast<dwarf::LoclistEntries>(Data.getU8(C))) {
+  while (auto Kind = Data.getU8(C)) {
     Entry E;
     E.Kind = Kind;
     switch (Kind) {