[llvm] r374196 - DebugInfo: Shot in the dark attempt to fix ubsan error from r374122

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 11:37:13 PDT 2019


Author: dblaikie
Date: Wed Oct  9 11:37:13 2019
New Revision: 374196

URL: http://llvm.org/viewvc/llvm-project?rev=374196&view=rev
Log:
DebugInfo: Shot in the dark attempt to fix ubsan error from r374122

(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)

Modified:
    llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp?rev=374196&r1=374195&r2=374196&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp Wed Oct  9 11:37:13 2019
@@ -143,7 +143,7 @@ DWARFDebugLoclists::parseOneLocationList
   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) {




More information about the llvm-commits mailing list