diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2018-01-02 23:05:47 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2018-01-02 23:05:47 +0000 |
commit | 606fddaecab7587d3470a6f118c852cfbc0d7912 (patch) | |
tree | c52af1949620839141a702d42556555198994b6f | |
parent | a390e8baec0b07e6ad2b42911ceb6df2c266eab2 (diff) | |
download | clang-606fddaecab7587d3470a6f118c852cfbc0d7912.tar.gz |
[analyzer] do not crash with assertion on processing locations of bodyfarmed functions
This addresses an issue introduced in r183451: since
`removePiecesWithInvalidLocations` is called *after* `adjustCallLocations`,
it is not necessary, and in fact harmful, to have this assertion in
adjustCallLocations.
Addresses rdar://36170689
Differential Revision: https://reviews.llvm.org/D41680
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321682 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/StaticAnalyzer/Core/BugReporter.cpp | 1 | ||||
-rw-r--r-- | test/Analysis/call_once.cpp | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index dc284888eb..de0e87bb82 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -229,7 +229,6 @@ adjustCallLocations(PathPieces &Pieces, PathDiagnosticCallPiece *Call = dyn_cast<PathDiagnosticCallPiece>(I->get()); if (!Call) { - assert((*I)->getLocation().asLocation().isValid()); continue; } diff --git a/test/Analysis/call_once.cpp b/test/Analysis/call_once.cpp index db9e5cc7ca..445c616b3c 100644 --- a/test/Analysis/call_once.cpp +++ b/test/Analysis/call_once.cpp @@ -1,10 +1,11 @@ -// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -verify %s -// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -DEMULATE_LIBSTDCPP -verify %s +// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -verify %s -o %t.report +// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -DEMULATE_LIBSTDCPP -verify %s -o %t.report // We do NOT model libcxx03 implementation, but the analyzer should still // not crash. -// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -DEMULATE_LIBCXX03 -verify %s -// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -DEMULATE_LIBCXX03 -DEMULATE_LIBSTDCPP -verify %s +// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -DEMULATE_LIBCXX03 -verify %s -o %t.report +// RUN: %clang_analyze_cc1 -std=c++11 -fblocks -analyzer-checker=core,debug.ExprInspection -DEMULATE_LIBCXX03 -DEMULATE_LIBSTDCPP -verify %s -o %t.report +// RUN: rm -rf %t.report void clang_analyzer_eval(bool); |