getCheckerManager().runCheckersForPreStmt(checkerPreStmt, Pred, A, *this);
StmtNodeBuilder Bldr(checkerPreStmt, Dst, *currBldrCtx);
+ assert(A->isGLValue() ||
+ (!AMgr.getLangOpts().CPlusPlus &&
+ A->getType().isCForbiddenLValueType()));
for (ExplodedNodeSet::iterator it = checkerPreStmt.begin(),
ei = checkerPreStmt.end(); it != ei; ++it) {
SVal V = state->getLValue(A->getType(),
state->getSVal(Idx, LCtx),
state->getSVal(Base, LCtx));
- assert(A->isGLValue());
Bldr.generateNode(A, *it, state->BindExpr(A, LCtx, V), nullptr,
ProgramPoint::PostLValueKind);
}
return ((char *)&(((struct s*)0)->data_array)) - ((char *)0); // no-warning
}
+int testPointerArithmeticOnVoid(void *bytes) {
+ int p = 0;
+ if (&bytes[0] == &bytes[1])
+ return 6/p; // no-warning
+ return 0;
+}
+
+int testRValueArraySubscriptExpr(void *bytes) {
+ int *p = (int*)&bytes[0];
+ *p = 0;
+ if (*(int*)&bytes[0] == 0)
+ return 0;
+ return 5/(*p); // no-warning
+}
+
+