if (!Att->isNonNull(idx))
continue;
- const DefinedSVal &V = cast<DefinedSVal>(state->getSVal(*I));
+ SVal V = state->getSVal(*I);
+ DefinedSVal *DV = dyn_cast<DefinedSVal>(&V);
+
+ // If the value is unknown or undefined, we can't perform this check.
+ if (!DV)
+ continue;
ConstraintManager &CM = C.getConstraintManager();
const GRState *stateNotNull, *stateNull;
- llvm::tie(stateNotNull, stateNull) = CM.AssumeDual(state, V);
+ llvm::tie(stateNotNull, stateNull) = CM.AssumeDual(state, *DV);
if (stateNull && !stateNotNull) {
// Generate an error node. Check for a null node in case
}
}
+void f6e(int *p, int offset) {
+ // PR7406 - crash from treating an UnknownVal as defined, to see if it's 0.
+ bar((p+offset)+1, 0); // not crash
+}
+
int* qux();
int f7(int x) {