This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Dump checker name if multiple checkers evaluate the same call
ClosedPublic

Authored by steakhal on Oct 31 2021, 10:54 AM.

Details

Summary

Previously, if accidentally multiple checkers eval::Call-ed the same
CallEvent, in debug builds the analyzer detected this and crashed
with the message stating this. Unfortunately, the message did not state
the offending checkers violating this invariant.
This revision addresses this by printing a more descriptive message
before aborting.

Diff Detail

Event Timeline

steakhal created this revision.Oct 31 2021, 10:54 AM
steakhal requested review of this revision.Oct 31 2021, 10:54 AM

Thanks, LGTM! (with nits).

clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
679

Optional implicitly converts to bool and IMHO this way it is easier to read the code.

680
clang/unittests/StaticAnalyzer/ConflictingEvalCallsTest.cpp
58

Let's hope this will not break windows and other exotic build bots.

martong accepted this revision.Nov 2 2021, 5:59 AM
This revision is now accepted and ready to land.Nov 2 2021, 5:59 AM
This revision was automatically updated to reflect the committed changes.
steakhal marked 2 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 6:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Committed with the requested changes.

clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
679

I guess it's up to personal taste.
I'm okay either way, but I more frequently stick to the explicit way of checking this.