[llvm-bugs] [Bug 28009] New: Size of a struct or a union is not limited

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 5 08:37:01 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28009

            Bug ID: 28009
           Summary: Size of a struct or a union is not limited
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ch3root at openwall.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

While size of an array is limited this is not the case for structs and unions.
For example, on x86-32, structs larger than SIZE_MAX bytes are accepted. Or, on
x86-64, clang aborts on the following definitions:

struct { char a[-1ul / 8]; char b; } s;
union { char a[-1ul / 8]; int b; } u;

clang-3.9: .../llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:557: void
{anonymous}::CGRecordLowering::clipTailPadding(): Assertion `Prior->Kind ==
MemberInfo::Field && !Prior->FD && "Only storage fields have tail padding!"'
failed.


clang version: clang version 3.9.0 (trunk 271312)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160605/e61bafa7/attachment.html>


More information about the llvm-bugs mailing list