[llvm-bugs] [Bug 37312] New: Assertion failure in create_call_once_funcptr_call()

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 2 06:24:04 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37312

            Bug ID: 37312
           Summary: Assertion failure in create_call_once_funcptr_call()
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: ekarpenkov at apple.com
          Reporter: alexfh at google.com
                CC: dcoughlin at apple.com, ganna at apple.com,
                    llvm-bugs at lists.llvm.org, noqnoqneo at gmail.com

$ cat test-CFGBuilder__appendCall.cc
namespace std {
struct a {
  int _M_once;
};
template <typename b, typename... c>
void call_once(b &&, c &&...);
}  // namespace std
class d {
  typedef void (*e)(int *, d *);
  int f;
  void g() { call_once(h, i, &f, this); }
  e i;
  std::a h;
};
$ ./clang-tidy -checks=-*,clang-analyzer* test-CFGBuilder__appendCall.cc --
-std=c++11 -fsized-deallocation -Wno-everything
assert.h assertion failed at llvm/tools/clang/lib/AST/Expr.cpp:1570 in bool
clang::CastExpr::CastConsistency() const:
getSubExpr()->getType()->isFunctionType()
    @     0x5627c34d9c56  __assert_fail
    @     0x5627c22b2036  clang::CastExpr::CastConsistency()
    @     0x5627c1961767  clang::CastExpr::CastExpr()
    @     0x5627c22b25f4  clang::ImplicitCastExpr::Create()
    @     0x5627c1e8f8dd  create_call_once_funcptr_call()
    @     0x5627c1e8e2b2  create_call_once()
    @     0x5627c1e8d274  clang::BodyFarm::getBody()
    @     0x5627c1e83fa4  clang::AnalysisDeclContext::getBody()
    @     0x5627c1273a48  clang::ento::AnyFunctionCall::getRuntimeDefinition()
    @     0x5627c12cd3b6  clang::ento::ExprEngine::defaultEvalCall()
    @     0x5627c1288429  clang::ento::CheckerManager::runCheckersForEvalCall()
    @     0x5627c12cbf33  clang::ento::ExprEngine::evalCall()
    @     0x5627c12cbcc2  clang::ento::ExprEngine::VisitCallExpr()
    @     0x5627c1299633  clang::ento::ExprEngine::Visit()
    @     0x5627c12953ae  clang::ento::ExprEngine::ProcessStmt()
    @     0x5627c12950cb  clang::ento::ExprEngine::processCFGElement()
    @     0x5627c12b99c5  clang::ento::CoreEngine::HandlePostStmt()
    @     0x5627c12b8e1d  clang::ento::CoreEngine::ExecuteWorkList()
    @     0x5627c0fed7ac  (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
    @     0x5627c0fed326  (anonymous namespace)::AnalysisConsumer::HandleCode()
    @     0x5627c0fd9094  (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/20180502/376c3c9d/attachment.html>


More information about the llvm-bugs mailing list