summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/Record.cpp
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2014-12-12 21:48:03 +0000
committerMichael Ilseman <milseman@apple.com>2014-12-12 21:48:03 +0000
commit5be22a12c2fdb4e13ead4b2e8a8a68f07fb1f270 (patch)
treed32cd1ee5853b7b127f7bc8acbb58e753c5feccd /llvm/lib/TableGen/Record.cpp
parent90482a77b114ba612951233d90f0173d7b7d04a6 (diff)
downloadbcm5719-llvm-5be22a12c2fdb4e13ead4b2e8a8a68f07fb1f270.tar.gz
bcm5719-llvm-5be22a12c2fdb4e13ead4b2e8a8a68f07fb1f270.zip
Clean up static analyzer warnings.
Clang's static analyzer found several potential cases of undefined behavior, use of un-initialized values, and potentially null pointer dereferences in tablegen, Support, MC, and ADT. This cleans them up with specific assertions on the assumptions of the code. llvm-svn: 224154
Diffstat (limited to 'llvm/lib/TableGen/Record.cpp')
-rw-r--r--llvm/lib/TableGen/Record.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 34e3ab4a2e3..3a2ae96340c 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -812,7 +812,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
return VarInit::get(MCName, RV->getType());
}
}
-
+ assert(CurRec && "NULL pointer");
if (Record *D = (CurRec->getRecords()).getDef(Name))
return DefInit::get(D);
OpenPOWER on IntegriCloud