This patch is a band-aid. A proper solution would be too change trackNullOrUndefValue to only try to dereference the pointer when it is relevant to the problem.
Details
Details
Diff Detail
Diff Detail
Event Timeline
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | ||
---|---|---|
1742 | I almost want to make Optional<Loc> non-convertible to bool, because it's almost always a bad idea to make decisions based on Loc-ness of SVal, as a lot of code assumes that Loc means lvalue, which is completely incorrect. |
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | ||
---|---|---|
1760 | The problem is FindLastStoreBRVisitor will later crash without this branch when attempting to dereference the region. |
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | ||
---|---|---|
1760 | Oh right, thanks! |
I almost want to make Optional<Loc> non-convertible to bool, because it's almost always a bad idea to make decisions based on Loc-ness of SVal, as a lot of code assumes that Loc means lvalue, which is completely incorrect.