diff options
author | Kristof Umann <dkszelethus@gmail.com> | 2019-03-14 16:10:29 +0000 |
---|---|---|
committer | Kristof Umann <dkszelethus@gmail.com> | 2019-03-14 16:10:29 +0000 |
commit | 4962816e7242b9cec7a1a1157e4efaac75a6120a (patch) | |
tree | 2ddff6e82f79a0a6ef6901f2058909cad53bf67c /clang/docs/analyzer | |
parent | ac093d61c468b96f82d719f75e4dca8eab1e85cb (diff) | |
download | bcm5719-llvm-4962816e7242b9cec7a1a1157e4efaac75a6120a.tar.gz bcm5719-llvm-4962816e7242b9cec7a1a1157e4efaac75a6120a.zip |
[analyzer] Fix an assertation failure for invalid sourcelocation, add a new debug checker
For a rather short code snippet, if debug.ReportStmts (added in this patch) was
enabled, a bug reporter visitor crashed:
struct h {
operator int();
};
int k() {
return h();
}
Ultimately, this originated from PathDiagnosticLocation::createMemberLoc, as it
didn't handle the case where it's MemberExpr typed parameter returned and
invalid SourceLocation for MemberExpr::getMemberLoc. The solution was to find
any related valid SourceLocaion, and Stmt::getBeginLoc happens to be just that.
Differential Revision: https://reviews.llvm.org/D58777
llvm-svn: 356161
Diffstat (limited to 'clang/docs/analyzer')
-rw-r--r-- | clang/docs/analyzer/developer-docs/DebugChecks.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/docs/analyzer/developer-docs/DebugChecks.rst b/clang/docs/analyzer/developer-docs/DebugChecks.rst index bb2f37f3395..56ce015d645 100644 --- a/clang/docs/analyzer/developer-docs/DebugChecks.rst +++ b/clang/docs/analyzer/developer-docs/DebugChecks.rst @@ -285,3 +285,10 @@ There is also an additional -analyzer-stats flag, which enables various statistics within the analyzer engine. Note the Stats checker (which produces at least one bug report per function) may actually change the values reported by -analyzer-stats. + +Output testing checkers +======================= + +- debug.ReportStmts reports a warning at **every** statement, making it a very + useful tool for testing thoroughly bug report construction and output + emission. |