summaryrefslogtreecommitdiffstats
path: root/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2014-02-26 01:20:19 +0000
committerJordan Rose <jordan_rose@apple.com>2014-02-26 01:20:19 +0000
commite1805368a8a09000b3be70b50e20522efb78581e (patch)
tree55fdc6db0189ba5ce88185edabd57f17db09a22a /lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
parent4a7f7947a3f66658d68926182842e08d40d93d45 (diff)
[analyzer] NonNullParamChecker: don't freak out about nested transparent_unions.
For now, just ignore them. Later, we could try looking through LazyCompoundVals, but we at least shouldn't crash. <rdar://problem/16153464> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp b/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
index c9b86399fd..f9a43ad803 100644
--- a/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
@@ -104,7 +104,9 @@ void NonNullParamChecker::checkPreCall(const CallEvent &Call,
V = *CSV_I;
DV = V.getAs<DefinedSVal>();
assert(++CSV_I == CSV->end());
- if (!DV)
+ // FIXME: Handle (some_union){ some_other_union_val }, which turns into
+ // a LazyCompoundVal inside a CompoundVal.
+ if (!V.getAs<Loc>())
continue;
// Retrieve the corresponding expression.
if (const CompoundLiteralExpr *CE = dyn_cast<CompoundLiteralExpr>(ArgE))