This fixes Bugzilla #9806.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130422
91177308-0d34-0410-b5e6-
96231b3b80d8
const Expr *lenExpr = CE->getArg(2);
SVal lenVal = state->getSVal(lenExpr);
+ // Cast the length to a NonLoc SVal. If it is not a NonLoc then give up.
NonLoc *strLengthNL = dyn_cast<NonLoc>(&strLength);
+ if (!strLengthNL)
+ return;
+
+ // Cast the max length to a NonLoc SVal. If it is not a NonLoc then give up.
NonLoc *lenValNL = dyn_cast<NonLoc>(&lenVal);
+ if (!lenValNL)
+ return;
QualType cmpTy = C.getSValBuilder().getContext().IntTy;
const GRState *stateTrue, *stateFalse;