[llvm-bugs] [Bug 41687] New: Assertion failure on expression statement: StaticAnalyzer/Core/ExprEngine.cpp:2240: virtual void clang::ento::ExprEngine::processEndOfFunction(clang::ento::NodeBuilderContext &, clang::ento::ExplodedNode *, const clang::ReturnStmt *): Assertion `I.first.g

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 1 09:05:20 PDT 2019


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

            Bug ID: 41687
           Summary: Assertion failure on expression statement:
                    StaticAnalyzer/Core/ExprEngine.cpp:2240: virtual void
                    clang::ento::ExprEngine::processEndOfFunction(clang::e
                    nto::NodeBuilderContext &, clang::ento::ExplodedNode
                    *, const clang::ReturnStmt *): Assertion `I.first.g
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: gribozavr at gmail.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

At SVN r359691:

$ cat /tmp/t.cc
struct Foo {};
struct FooAndInt {
  FooAndInt(Foo, int) {}
};
void entry(int x) {
  FooAndInt(Foo(), ({
              return;
              x;
            }));
}

$ ./bin/clang-tidy -checks="-*,clang-analyzer*" /tmp/t.cc
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "/tmp/t.cc"
No compilation database found in /tmp or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or
directory
json-compilation-database: Error while opening JSON database: No such file or
directory
Running without flags.
clang-tidy: llvm-project/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:2240:
virtual void
clang::ento::ExprEngine::processEndOfFunction(clang::ento::NodeBuilderContext
&, clang::ento::ExplodedNode *, const clang::ReturnStmt *): Assertion
`I.first.getItem().getKind() ==
ConstructionContextItem::TemporaryDestructorKind || I.first.getItem().getKind()
== ConstructionContextItem::ElidedDestructorKind' failed.
 #0 0x0000000000687f04 PrintStackTraceSignalHandler(void*)
(./bin/clang-tidy+0x687f04)
 #1 0x0000000000685c9c llvm::sys::RunSignalHandlers()
(./bin/clang-tidy+0x685c9c)
 #2 0x0000000000688448 SignalHandler(int) (./bin/clang-tidy+0x688448)
 #3 0x00007fe1f4ca90c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
 #4 0x00007fe1f3833fcf raise (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
 #5 0x00007fe1f38353fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
 #6 0x00007fe1f382ce37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
 #7 0x00007fe1f382cee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
 #8 0x0000000000da8bbf
clang::ento::ExprEngine::processEndOfFunction(clang::ento::NodeBuilderContext&,
clang::ento::ExplodedNode*, clang::ReturnStmt const*)
(./bin/clang-tidy+0xda8bbf)
 #9 0x0000000000d9020f
clang::ento::CoreEngine::HandleBlockEdge(clang::BlockEdge const&,
clang::ento::ExplodedNode*) (./bin/clang-tidy+0xd9020f)
#10 0x0000000000d8fbdd
clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*,
clang::ProgramPoint, clang::ento::WorkListUnit const&)
(./bin/clang-tidy+0xd8fbdd)
#11 0x0000000000d8f7ab
clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*,
unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>)
(./bin/clang-tidy+0xd8f7ab)
#12 0x0000000000b36c97 (anonymous
namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*) (./bin/clang-tidy+0xb36c97)
#13 0x0000000000b2f815 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
(./bin/clang-tidy+0xb2f815)
#14 0x0000000000f1f14c
clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&)
(./bin/clang-tidy+0xf1f14c)
#15 0x000000000107b5c3 clang::ParseAST(clang::Sema&, bool, bool)
(./bin/clang-tidy+0x107b5c3)
#16 0x0000000000f071f0 clang::FrontendAction::Execute()
(./bin/clang-tidy+0xf071f0)
#17 0x0000000000eac071
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(./bin/clang-tidy+0xeac071)
#18 0x0000000000a0d376
clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>,
clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>,
clang::DiagnosticConsumer*) (./bin/clang-tidy+0xa0d376)
#19 0x00000000006921d5
clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&,
clang::tooling::CompilationDatabase const&,
llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > >,
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool,
llvm::StringRef)::ActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>,
clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>,
clang::DiagnosticConsumer*) (./bin/clang-tidy+0x6921d5)
#20 0x0000000000a0d0e6 clang::tooling::ToolInvocation::runInvocation(char
const*, clang::driver::Compilation*,
std::shared_ptr<clang::CompilerInvocation>,
std::shared_ptr<clang::PCHContainerOperations>) (./bin/clang-tidy+0xa0d0e6)
#21 0x0000000000a0c997 clang::tooling::ToolInvocation::run()
(./bin/clang-tidy+0xa0c997)
#22 0x0000000000a0e81e
clang::tooling::ClangTool::run(clang::tooling::ToolAction*)
(./bin/clang-tidy+0xa0e81e)
#23 0x000000000068eac3
clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&,
clang::tooling::CompilationDatabase const&,
llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > >,
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, llvm::StringRef)
(./bin/clang-tidy+0x68eac3)
#24 0x00000000004326bd clang::tidy::clangTidyMain(int, char const**)
(./bin/clang-tidy+0x4326bd)
#25 0x00007fe1f38212b1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#26 0x000000000043079a _start (./bin/clang-tidy+0x43079a)
Aborted

-- 
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/20190501/6f09fb8e/attachment.html>


More information about the llvm-bugs mailing list