This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Add "Assuming..." diagnostic pieces for short-circuit logical operators.
ClosedPublic

Authored by NoQ on Sep 30 2016, 6:27 AM.

Details

Summary

Fix clang path event diagnostics around operators && and ||. Now there's a separate event for both sides of the operator.

Control flow pieces are unaffected - they're still broken, a bit more broken for operator ||.

This fix should go on top of D23300.

A few html examples:


Diff Detail

Event Timeline

NoQ updated this revision to Diff 73041.Sep 30 2016, 6:27 AM
NoQ retitled this revision from to [analyzer] Add "Assuming..." diagnostic pieces for short-circuit logical operators..
NoQ updated this object.
NoQ added a subscriber: cfe-commits.
zaks.anna edited edge metadata.Sep 30 2016, 9:18 AM

Looks good overall. Very minor nits.

lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
1274

nit: no comma before "and".

1288

It is not clear what the FIXME is for.

1302

Is this expected to ever trigger?

NoQ updated this revision to Diff 73472.Oct 4 2016, 6:57 AM
NoQ edited edge metadata.
NoQ marked 3 inline comments as done.

Fix review comments.

Correct the order of expected-notes in one of the tests (it doesn't affect how the test works).

lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
1302

Ouch right.

zaks.anna accepted this revision.Oct 4 2016, 11:55 AM
zaks.anna edited edge metadata.
This revision is now accepted and ready to land.Oct 4 2016, 11:55 AM
This revision was automatically updated to reflect the committed changes.