VisitCommonDeclRefExpr() should accept the ExplodedNode in CheckedSet as an argument, rather than Pred.
Details
- Reviewers
NoQ dcoughlin george.karpenkov - Commits
- rG74db26ff1458: [analyzer] Fix transitions in check::PreStmt<MemberExpr> checker callback.
rC324053: [analyzer] Fix transitions in check::PreStmt<MemberExpr> checker callback.
rL324053: [analyzer] Fix transitions in check::PreStmt<MemberExpr> checker callback.
Diff Detail
- Repository
- rL LLVM
Event Timeline
Ew. So it means that checker transitions are currently discarded. Great catch. I guess we don't use this functionality yet, so we can't test it, but the fix should definitely go in.
Then, again, i'm suspecting that you may want to use checkLocation or checkBind instead of checkPreStmt<MemberExpr> - i doubt that there's anything special about member expressions that make them different from other sorts of bindings. And if you're tracking how a symbol is assigned to a field of the structure - well, you shouldn't, this info is already in the program state and you can retrieve it any time with getSVal(Region).
You are right, that's why I don't know how to add test for this change.
Then, again, i'm suspecting that you may want to use checkLocation or checkBind instead of checkPreStmt<MemberExpr> - i doubt that there's anything special about member expressions that make them different from other sorts of bindings. And if you're tracking how a symbol is assigned to a field of the structure - well, you shouldn't, this info is already in the program state and you can retrieve it any time with getSVal(Region).
Thanks for your explanation, NoQ. I discovered the problem by chance, and I'll take your advice when it comes to dealing with MemberExpr.
And I have no commit access. If you plan to commit this change, I hope you can help me commit it, thank you in advance!