This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer] Fix a typo in `ExprEngine::VisitMemberExpr`
ClosedPublic

Authored by MTC on Feb 1 2018, 1:42 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

MTC created this revision.Feb 1 2018, 1:42 AM
MTC edited the summary of this revision. (Show Details)Feb 1 2018, 1:43 AM
NoQ accepted this revision.Feb 1 2018, 11:10 AM

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).

This revision is now accepted and ready to land.Feb 1 2018, 11:10 AM
MTC added a comment.Feb 1 2018, 6:12 PM
In D42785#995211, @NoQ wrote:

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.

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!

This revision was automatically updated to reflect the committed changes.