This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer
ClosedPublic

Authored by vrnithinkumar on Sep 2 2020, 9:56 AM.

Details

Summary
  • Adding the test case after checkLiveSymbols implementation checked in

Diff Detail

Event Timeline

vrnithinkumar created this revision.Sep 2 2020, 9:56 AM
vrnithinkumar requested review of this revision.Sep 2 2020, 9:56 AM
vrnithinkumar edited the summary of this revision. (Show Details)Sep 2 2020, 10:00 AM
NoQ added a comment.Sep 2 2020, 11:58 PM

Nice catch, thx!

clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp
106–107

The intended ultimate test is !State->assume(X) and it's also much easier to write. I strongly suspect that we should remove these other APIs; they're only confusing.

Szelethus added a comment.EditedSep 25 2020, 3:00 AM

Congrats on your GSoC! Unless I missed it, it seems like you haven't posted your final report on cfe-dev, even though its an amazing looking document with a lot of examples and explanations. I think it would be great to spread the message, its a work to be proud of!

Congrats on your GSoC! Unless I missed it, it seems like you haven't posted your final report on cfe-dev, even though its an amazing looking document with a lot of examples and explanations. I think it would be great to spread the message, its a work to be proud of!

I am sorry, I took a break and I forgot about sharing the final report.
Thanks for the reminder.

  • Addressing review comment
vrnithinkumar marked an inline comment as done.Oct 7 2020, 2:01 PM
vrnithinkumar added inline comments.
clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp
106–107

Sorry for addressing the pending comment so late. :(
I was busy with my postponed exams.

NoQ accepted this revision.Oct 7 2020, 5:35 PM

Looks great, thank you! I think you can commit it :)

This revision is now accepted and ready to land.Oct 7 2020, 5:35 PM
This revision was landed with ongoing or failed builds.Oct 9 2020, 4:43 AM
This revision was automatically updated to reflect the committed changes.
vrnithinkumar marked an inline comment as done.