[LLVMbugs] [Bug 8894] New: Clang++ misses an invalid construct in Sema and assert in codegen.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 3 03:11:27 PST 2011


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

           Summary: Clang++ misses an invalid construct in Sema and assert
                    in codegen.
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5946)
 --> (http://llvm.org/bugs/attachment.cgi?id=5946)
Make clang assert

Attached is a sample where clang++ does not emit any diagnostic (where it
should) and so try to codegen invalid code (and assert).

> clang++ --version
clang version 2.9 (trunk 122743)
Target: x86_64-apple-darwin10
Thread model: posix

> clang++ Metadata.cpp
Assertion failed: (E && !hasAggregateLLVMType(E->getType()) && "Invalid scalar
expression to emit"), function EmitScalarExpr, file
/Volumes/MacPro/Projects/OpenSource/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp,
line 2515.
0  clang             0x0000000100eb6aa2 PrintStackTrace(void*) + 34
1  clang             0x0000000100eb7049 SignalHandler(int) + 857
2  libSystem.B.dylib 0x00007fff8326667a _sigtramp + 26
3  libSystem.B.dylib 0x010000010204ba01 _sigtramp + 2128499617
4  clang             0x0000000100011b06 abort + 22
5  clang             0x0000000100011ac8 __assert_rtn + 56
6  clang             0x0000000100186f5e
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 222
7  clang             0x000000010019139a clang::StmtVisitor<(anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 21242
8  clang             0x0000000100186f3d
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 189
[…]
1.    <eof> parser at end of file
2.    Metadata.cpp:15:13: LLVM IR generation of declaration 'test'
3.    Metadata.cpp:15:13: Generating code for declaration 'test'
4.    Metadata.cpp:15:20: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Illegal instruction
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

-- 
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