[LLVMbugs] [Bug 7736] New: Assertion "Call must have function pointer type" on valid code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 28 07:01:47 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7736

           Summary: Assertion "Call must have function pointer type" on
                    valid code
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5284)
 --> (http://llvm.org/bugs/attachment.cgi?id=5284)
Asserting testcase

The attached code, reduced from a test case provided by "cizra" on IRC, causes
an assertion on clang++. The code is, I believe, valid.

Backtrace:

clang: CGExpr.cpp:2065: clang::CodeGen::RValue
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, llvm::Value*,
clang::CodeGen::ReturnValueSlot, clang::ConstExprIterator,
clang::ConstExprIterator, const clang::Decl*): Assertion
`CalleeType->isFunctionPointerType() && "Call must have function pointer
type!"' failed.
0  clang           0x0000000001572e1f
1  clang           0x0000000001574eb2
2  libpthread.so.0 0x00007f2203cbc8f0
3  libc.so.6       0x00007f2202faba75 gsignal + 53
4  libc.so.6       0x00007f2202faf5c0 abort + 384
5  libc.so.6       0x00007f2202fa4941 __assert_fail + 241
6  clang           0x000000000078b5ef
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, llvm::Value*,
clang::CodeGen::ReturnValueSlot, clang::ConstExprIterator,
clang::ConstExprIterator, clang::Decl const*) + 127
7  clang           0x000000000078d518
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot) + 296
8  clang           0x00000000007b1d32
9  clang           0x00000000007b8f20
10 clang           0x00000000007bd7f7
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 87
11 clang           0x000000000078add7
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, llvm::Value*,
bool, bool, bool) + 247
12 clang           0x0000000000807464
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 148
13 clang           0x000000000080a21f
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, llvm::Value*, bool) + 239
14 clang           0x000000000080a4dc
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 236
15 clang           0x00000000008073ec
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 28
16 clang           0x0000000000826a3b
clang::CodeGen::CodeGenFunction::GenerateCode(clang::CodeGen::GlobalDecl,
llvm::Function*) + 875
17 clang           0x000000000073ff23
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::CodeGen::GlobalDecl)
+ 531
18 clang           0x000000000074164b
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::CodeGen::GlobalDecl)
+ 267
19 clang           0x0000000000742427
clang::CodeGen::CodeGenModule::EmitDeferred() + 151
20 clang           0x00000000007424a9 clang::CodeGen::CodeGenModule::Release()
+ 9
21 clang           0x0000000000733858
22 clang           0x000000000084a82f clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 351
23 clang           0x0000000000734744 clang::CodeGenAction::ExecuteAction() +
68
24 clang           0x000000000064f285
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 357
25 clang           0x00000000006303cc cc1_main(char const**, char const**, char
const*, void*) + 2748
26 clang           0x0000000000637247 main + 3527
27 libc.so.6       0x00007f2202f96c4d __libc_start_main + 253
28 clang           0x000000000062e3c9

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list