<div dir="ltr">Gábor,<br><br>Thanks for the helpful suggestions. Your suspicion that checkPreCall is not invoked for the entry function was correct. My current solution looks like this:<div><br></div><div><div>void Checker::checkPostStmt(const Expr* S, CheckerContext &C) const {</div>
<div> if (const DeclRefExpr* expr = dyn_cast<DeclRefExpr>(S->IgnoreImplicit())) {</div><div> if (const ParmVarDecl* param = dyn_cast<ParmVarDecl>(expr->getDecl())) {</div><div> const SymbolRef sym = C.getSVal(S).getAsSymbol();</div>
<div> if (!sym) return;</div><div> ProgramStateRef State = C.getState();</div><div> const MyState* arg_state = State->get<MyMap>(sym);</div><div> if (arg_state) return; // Only interested in first encounter</div>
<div> ......</div><div> }</div><div> }</div><div>}</div></div><div><br></div><div>For some reason it did not work to register for PostStmt<DeclRefExpr>. I believe the checker does not descend into ImplicitCast expressions.... so I did that part manually. A bit of a hack, but it gets the job done, and it has the lazy-initialized quality that you mentioned.</div>
<div><br></div><div>On a somewhat related note, I noticed that unused function parameters are never reaped by the DeadSymbols callback. I'm considering doing my own special handling for these, as I need to know when a parameter is 'leaked' for my purposes. Any ideas there?</div>
<div><br></div><div>Best and thanks again,</div><div>Aemon</div><div><br></div></div>