Index: lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp +++ lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp @@ -98,8 +98,6 @@ if (!DV) continue; - assert(!haveRefTypeParam || DV->getAs()); - // Process the case when the argument is not a location. if (haveAttrNonNull && !DV->getAs()) { // If the argument is a union type, we want to handle a potential @@ -123,8 +121,6 @@ assert(++CSV->begin() == CSV->end()); // FIXME: Handle (some_union){ some_other_union_val }, which turns into // a LazyCompoundVal inside a CompoundVal. - if (!V.getAs()) - continue; // Retrieve the corresponding expression. if (const auto *CE = dyn_cast(ArgE)) @@ -132,6 +128,9 @@ ArgE = dyn_cast(*(IE->begin())); } + if (!V.getAs()) + continue; + ConstraintManager &CM = C.getConstraintManager(); ProgramStateRef stateNotNull, stateNull; std::tie(stateNotNull, stateNull) = CM.assumeDual(state, *DV);