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

           Summary: Flexible array members not initialized properly
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=7065)
 --> (http://llvm.org/bugs/attachment.cgi?id=7065)
An example of the bug

A flexible array member in a struct is only initialized when static or const.
The attached example prints garbage when used with an automatic struct or any
compound literal or pointer to compound literal, whether the struct is used in
the same function or a pointer to it is passed to another function. The
assembly code shows the data for the two structs that print correctly, but
strangely also has struct "vec2" with the right values even though it's still
uninitialized when running the program. The values of the other structs don't
appear in the assembly code at all and it looks like it's just copying random
junk off the stack.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to