This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Treat C++ throw as sink during CFG-based suppress-on-sink.
ClosedPublic

Authored by NoQ on Jul 20 2017, 3:46 AM.

Details

Summary

Because throws produce sinks during symbolic execution, we need to treat them as noreturn during our suppress-on-sink analysis as well. This would get a lot less conservative when CFG actually supports exceptions.

Diff Detail

Event Timeline

a.sidorin accepted this revision.Jul 21 2017, 1:15 AM

Looks good.

This revision is now accepted and ready to land.Jul 21 2017, 1:15 AM
xazax.hun accepted this revision.Jul 21 2017, 1:40 AM

One minor nit, otherwise looks good to me.

lib/StaticAnalyzer/Core/BugReporter.cpp
3350

For temporary solutions like this, I prefer to have a FIXME string in the comment. In general, I think it is good to be able to keep track of future tasks by grepping for FIXMEs in the code of the analyzer.

NoQ updated this revision to Diff 107872.Jul 24 2017, 2:51 AM

Rebase. Turn the comment into a FIXME.

NoQ updated this revision to Diff 107873.Jul 24 2017, 2:54 AM

Bring back the test that was accidentally lost.

This revision was automatically updated to reflect the committed changes.
dcoughlin edited edge metadata.Jul 25 2017, 10:05 AM

Do we have a radar for this? It sounds familiar.

cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
3313 ↗(On Diff #108029)

Maybe a better name for this would be "treatAsSink"? This way people won't use it as short-hand for whether the block has a no-return element.