[llvm] r285597 - SymbolRef::Type is not a bitfield and must be compared directly

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 10:11:24 PDT 2016


Author: majnemer
Date: Mon Oct 31 12:11:23 2016
New Revision: 285597

URL: http://llvm.org/viewvc/llvm-project?rev=285597&view=rev
Log:
SymbolRef::Type is not a bitfield and must be compared directly

Found by PVS-Studio.

Modified:
    llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp

Modified: llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp?rev=285597&r1=285596&r2=285597&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp (original)
+++ llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp Mon Oct 31 12:11:23 2016
@@ -445,7 +445,7 @@ void MachODebugMapParser::loadMainBinary
     }
     SymbolRef::Type Type = *TypeOrErr;
     // Skip undefined and STAB entries.
-    if ((Type & SymbolRef::ST_Debug) || (Type & SymbolRef::ST_Unknown))
+    if ((Type == SymbolRef::ST_Debug) || (Type == SymbolRef::ST_Unknown))
       continue;
     // The only symbols of interest are the global variables. These
     // are the only ones that need to be queried because the address




More information about the llvm-commits mailing list