[llvm-bugs] [Bug 36408] New: Assertion failure in clang::ento::CXXInstanceCall::getInitialStackFrameContents

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 16 04:50:27 PST 2018


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

            Bug ID: 36408
           Summary: Assertion failure in
                    clang::ento::CXXInstanceCall::getInitialStackFrameCont
                    ents
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            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

$ cat test-CXXInstanceCall__getInitialStackFrameContents.cc
void *operator new(unsigned long, void *);
class a;
class b {
 public:
  a *operator->() {
    a *c = reinterpret_cast<a *>(&d);
    return c;
  }
  template <class e>
  void f() {
    new (&d) e;
  }
  int d;
};
class a {
 public:
  virtual char *g();
};
class j : a {
  char *g() {}
};
void h() {
  b i;
  i.f<j>();
  i->g();
}
$ clang-tidy -checks=-*,clang-analyzer*
test-CXXInstanceCall__getInitialStackFrameContents.cc -- -std=c++11
assert.h assertion failed at
llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp:590 in virtual void
clang::ento::CXXInstanceCall::getInitialStackFrameContents(const
clang::StackFrameContext *, clang::ento::CallEvent::BindingsTy &) const:
!Failed && "Calling an incorrectly devirtualized method"
    @     0x559e50d78806  __assert_fail
    @     0x559e4f84fada 
clang::ento::CXXInstanceCall::getInitialStackFrameContents()
    @     0x559e4f7d8b62  clang::ento::StoreManager::enterStackFrame()
    @     0x559e4f821464  clang::ento::ProgramState::enterStackFrame()
    @     0x559e4f8a143f  clang::ento::ExprEngine::inlineCall()
    @     0x559e4f8a2e7b  clang::ento::ExprEngine::defaultEvalCall()
    @     0x559e4f8642d7  clang::ento::CheckerManager::runCheckersForEvalCall()
    @     0x559e4f8a1b03  clang::ento::ExprEngine::evalCall()
    @     0x559e4f8a1892  clang::ento::ExprEngine::VisitCallExpr()
    @     0x559e4f8712ca  clang::ento::ExprEngine::Visit()
    @     0x559e4f86d79e  clang::ento::ExprEngine::ProcessStmt()
    @     0x559e4f86d49b  clang::ento::ExprEngine::processCFGElement()
    @     0x559e4f88e625  clang::ento::CoreEngine::HandlePostStmt()
    @     0x559e4f88d8dd  clang::ento::CoreEngine::ExecuteWorkList()
    @     0x559e4e8b8dc3  (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()

-- 
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/20180216/15005857/attachment-0001.html>


More information about the llvm-bugs mailing list