[llvm-bugs] [Bug 37802] New: Assertion failure in NonNullParamChecker::checkPreCall
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jun 14 06:54:13 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=37802
Bug ID: 37802
Summary: Assertion failure in NonNullParamChecker::checkPreCall
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
Assignee: dcoughlin at apple.com
Reporter: alexfh at google.com
CC: ekarpenkov at apple.com, llvm-bugs at lists.llvm.org,
noqnoqneo at gmail.com
$ cat test-NonNullParamChecker__checkPreCall.cc
void *operator new(unsigned long, void *h) { return h; }
struct J {
int *p;
};
class X {
void *ar;
public:
X(void *t) : ar(t) {}
template <typename T>
void f(const T &t) {
new (ar) T(t);
}
};
class Y {
public:
template <typename T>
void f(T &&);
void f(J t) {
f(*t.p);
}
};
class Z {
int at() const {}
public:
Z(const Z &other) {
other.au(X(this));
}
template <typename T>
void au(T t) const {
void *c = const_cast<Z *>(this);
if(at()) {
t.f(*static_cast<J *>(c));
} else {
t.f(*static_cast<bool *>(c));
}
}
};
Z g() {
Z az = g();
Z e = az;
Y d;
e.au(d);
}
$ ./clang-tidy -checks=-*,clang-analyzer*
test-NonNullParamChecker__checkPreCall.cc --
assert.h assertion failed at
llvm/tools/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp:102 in
void (anonymous namespace)::NonNullParamChecker::checkPreCall(const
clang::ento::CallEvent &, clang::ento::CheckerContext &) const:
!haveRefTypeParam || DV->getAs<Loc>()
@ 0x55766e235e06 __assert_fail
@ 0x55766bd73f9e clang::ento::check::PreCall::_checkCall<>()
@ 0x55766bf4a2f9
clang::ento::CheckerManager::runCheckersForCallEvent()
@ 0x55766bf8a191 clang::ento::ExprEngine::evalCall()
@ 0x55766bf89fa2 clang::ento::ExprEngine::VisitCallExpr()
@ 0x55766bf5d283 clang::ento::ExprEngine::Visit()
@ 0x55766bf5980e clang::ento::ExprEngine::ProcessStmt()
@ 0x55766bf5952b clang::ento::ExprEngine::processCFGElement()
@ 0x55766bf77b45 clang::ento::CoreEngine::HandlePostStmt()
@ 0x55766bf76f9d clang::ento::CoreEngine::ExecuteWorkList()
@ 0x55766bcaf056 (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
@ 0x55766bcaebd6 (anonymous namespace)::AnalysisConsumer::HandleCode()
@ 0x55766bc9a934 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180614/9ca31e65/attachment-0001.html>
More information about the llvm-bugs
mailing list