Closed llvmbot closed 14 years ago
I can only guess, but it seems that in the switch in function GRExprEngine::VisitLValue Stmt::FloatingLiteralClass in unhandled.
Index: lib/Checker/GRExprEngine.cpp
--- lib/Checker/GRExprEngine.cpp (revision 109275) +++ lib/Checker/GRExprEngine.cpp (working copy) @@ -1058,6 +1058,7 @@ // In C++, binding an rvalue to a reference requires to create an object. case Stmt::CXXBoolLiteralExprClass: case Stmt::IntegerLiteralClass:
- case Stmt::FloatingLiteralClass: CreateCXXTemporaryObject(Ex, Pred, Dst); return;
I am unable to compile clang now, so I can't test it. But changing floats to ints in reduced test case causes clang to not crash.
Sorry for the spamming, but of course there can be other *LiteralClass that need to be handled in the same way, I am not sure if I found all of them: FloatingLiteralClass CharacterLiteralClass ImaginaryLiteral (?)
Yes, all of these cases need to be handled.
Fixed here:
http://llvm.org/viewvc/llvm-project?view=rev&revision=109719
I can only guess, but it seems that in the switch in function GRExprEngine::VisitLValue Stmt::FloatingLiteralClass in unhandled.
Index: lib/Checker/GRExprEngine.cpp
--- lib/Checker/GRExprEngine.cpp (revision 109275) +++ lib/Checker/GRExprEngine.cpp (working copy) @@ -1058,6 +1058,7 @@ // In C++, binding an rvalue to a reference requires to create an object. case Stmt::CXXBoolLiteralExprClass: case Stmt::IntegerLiteralClass:
- case Stmt::FloatingLiteralClass: CreateCXXTemporaryObject(Ex, Pred, Dst); return;
I am unable to compile clang now, so I can't test it. But changing floats to ints in reduced test case causes clang to not crash.
Sorry for the spamming, but of course there can be other *LiteralClass that need to be handled in the same way, I am not sure if I found all of them: FloatingLiteralClass CharacterLiteralClass ImaginaryLiteral (?)
I can only guess, but it seems that in the switch in function GRExprEngine::VisitLValue Stmt::FloatingLiteralClass in unhandled.
--- lib/Checker/GRExprEngine.cpp (revision 109275) +++ lib/Checker/GRExprEngine.cpp (working copy) @@ -1058,6 +1058,7 @@ // In C++, binding an rvalue to a reference requires to create an object. case Stmt::CXXBoolLiteralExprClass: case Stmt::IntegerLiteralClass:
I am unable to compile clang now, so I can't test it. But changing floats to ints in reduced test case causes clang to not crash.
assigned to @tkremenek
Extended Description
$ clang++ --version clang version 2.8 (trunk 108821) Target: i386-pc-linux-gnu Thread model: posix $ clang++ --analyze itm.cpp clang: /usr/src/llvm/src.llvm/tools/clang/lib/Checker/GRExprEngine.cpp:1075: void clang::GRExprEngine::VisitLValue(const clang::Expr, clang::ExplodedNode, clang::ExplodedNodeSet&): Assertion `(isa(Ex->getType().getDesugaredType()) || isa(Ex->getType().getDesugaredType())) && "Other kinds of expressions with non-aggregate/union/class types" " do not have lvalues."' failed.
0 clang 0x098d87dc
1 clang 0x098d8674
2 0xb775b400 __kernel_sigreturn + 0
3 libc.so.6 0xb74cdb82 abort + 386
4 libc.so.6 0xb74c38b8 assert_fail + 248
5 clang 0x08e8b1f9 clang::GRExprEngine::VisitLValue(clang::Expr const, clang::ExplodedNode, clang::ExplodedNodeSet&) + 1629
6 clang 0x08e8ed72 clang::GRExprEngine::VisitCall(clang::CallExpr const, clang::ExplodedNode, clang::ConstExprIterator, clang::ConstExprIterator, clang::ExplodedNodeSet&, bool) + 592
7 clang 0x08e8a32e clang::GRExprEngine::Visit(clang::Stmt const, clang::ExplodedNode, clang::ExplodedNodeSet&) + 1372
8 clang 0x08e89c80 clang::GRExprEngine::ProcessStmt(clang::CFGElement, clang::GRStmtNodeBuilder&) + 1532
9 clang 0x08e81b42 clang::GRCoreEngine::ProcessStmt(clang::CFGElement, clang::GRStmtNodeBuilder&) + 42
10 clang 0x08e829fb clang::GRCoreEngine::HandlePostStmt(clang::PostStmt const&, clang::CFGBlock const, unsigned int, clang::ExplodedNode) + 247
11 clang 0x08e82045 clang::GRCoreEngine::ExecuteWorkList(clang::LocationContext const, unsigned int) + 1025
12 clang 0x08e1a53a clang::GRExprEngine::ExecuteWorkList(clang::LocationContext const, unsigned int) + 46
13 clang 0x08e1767f
14 clang 0x08e1776e
15 clang 0x08e177f4
16 clang 0x08e173e7
17 clang 0x08e16e38
18 clang 0x08c2f073 clang::ParseAST(clang::Preprocessor&, clang::ASTConsumer, clang::ASTContext&, bool, bool, clang::CodeCompleteConsumer) + 727
19 clang 0x089dd853 clang::ASTFrontendAction::ExecuteAction() + 271
20 clang 0x089dd4c4 clang::FrontendAction::Execute() + 316
21 clang 0x089c8647 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 779
22 clang 0x0898a212 cc1_main(char const, char const, char const, void) + 1721
23 clang 0x08992f5d main + 495
24 libc.so.6 0xb74b6c76 libc_start_main + 230
25 clang 0x08988d81
Stack dump:
Please note that the actual compilation works fine.