This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Correctly create a non-fatal error node for VA list checker.
AbandonedPublic

Authored by george.karpenkov on Jun 22 2018, 6:19 PM.

Details

Reviewers
NoQ
dcoughlin

Diff Detail

Event Timeline

xazax.hun added inline comments.Jun 23 2018, 1:29 AM
clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
215

Note that the LeakedVALists might be empty. In that case, we generate an error node without emitting any warnings. Is this intended?

george.karpenkov planned changes to this revision.Jun 25 2018, 12:03 PM
george.karpenkov added inline comments.
clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
215

Good point, it also has an early return.

NoQ added a comment.Jun 25 2018, 4:00 PM

We noticed this when debugging D47856, because the visitor was saying "va_list ended" right before the report, because the key is indeed removed from the program state just before reporting the issue, so it's not there in the issue state and is there in the state before that.

Due to temporary insanity i thought that chaining two nodes together is the right approach here, but i guess other checkers work just fine without it, so i think it's most likely unnecessary.

Still, ideally we need to always generate[NonFatal]ErrorNode when we through our reports.

george.karpenkov abandoned this revision.Jun 25 2018, 4:23 PM

Turns out I don't need it for the other revision though.