Skip to content

The type loader has silent integer overflows #97412

Closed
@VSadov

Description

@VSadov

From: #95193 (comment)

These silent integer overflows are present in handling of LayoutKind.Sequential as well. For example, this:

Console.WriteLine(sizeof(X));

struct X
{
   byte x;
   BigArray a;
}

[StructLayout(LayoutKind.Sequential, Size = int.MaxValue)] 
struct BigArray
{
}

prints -2147483648.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-TypeSystem-coreclrin-prThere is an active PR which will close this issue when it is mergedruntime-coreclrspecific to the CoreCLR runtime

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions