summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2014-12-15 18:48:43 +0000
committerMichael Ilseman <milseman@apple.com>2014-12-15 18:48:43 +0000
commitaddddc441f9c7fbd4ed70bc5a3256c385599929d (patch)
treed418ffd0237296eef0ec82e40c001e7771dc66c3 /llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
parentb736bf38990c4d474b1267f90c0706a3c983a10f (diff)
downloadbcm5719-llvm-addddc441f9c7fbd4ed70bc5a3256c385599929d.tar.gz
bcm5719-llvm-addddc441f9c7fbd4ed70bc5a3256c385599929d.zip
Silence more static analyzer warnings.
Add in definedness checks for shift operators, null checks when pointers are assumed by the code to be non-null, and explicit unreachables. llvm-svn: 224255
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
index 583e70055c0..b16a53cbb78 100644
--- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
@@ -76,7 +76,9 @@ void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS, DWARFUnit *u,
static void dumpApplePropertyAttribute(raw_ostream &OS, uint64_t Val) {
OS << " (";
do {
- uint64_t Bit = 1ULL << countTrailingZeros(Val);
+ uint64_t Shift = countTrailingZeros(Val);
+ assert(Shift < 64 && "undefined behavior");
+ uint64_t Bit = 1ULL << Shift;
if (const char *PropName = ApplePropertyString(Bit))
OS << PropName;
else
OpenPOWER on IntegriCloud