[LLVMbugs] [Bug 1886] New: Crash with incomplete struct initializer

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Dec 29 16:01:53 PST 2007


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

           Summary: Crash with incomplete struct initializer
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


using clang -emit-llvm, the following crashes with an assertion failure:

struct a {int b; int c};
struct a c = {5};

The assertion:
clang: /home/eli/llvm/lib/VMCore/Constants.cpp:367:
llvm::ConstantStruct::ConstantStruct(const llvm::StructType*, const
std::vector<llvm::Constant*, std::allocator<llvm::Constant*> >&): Assertion
`V.size() == T->getNumElements() && "Invalid initializer vector for constant
structure"' failed.

Looks like just a missing case in codegen, since both "struct a c = {};" and
"struct a c = {5,3};" currently work correctly.


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