Skip to content

Structures with fixed buffers sometimes misclassified in SystemV eightbyte classification #11822

@jkoritzinsky

Description

@jkoritzinsky

The struct below is misclassified by the SystemV classifier:

[StructLayout(LayoutKind.Sequential)]
public unsafe struct FixedBufferClassificationTest
{
    public fixed int arr[3];
    public float f;
}

The two eightbytes should both be classified as INTEGER eightbytes; however, the runtime sees the type above as equivalent to the following:

[StructLayout(LayoutKind.Sequential)]
public unsafe struct FixedBufferClassificationTest
{
    [StructLayout(LayoutKind.Sequential, Size=12)]
    private struct FixedBufferType
    {
         private int i;
    }
    [FixedBufferAttribute(typeof(int),3)]
    public FixedBufferType arr;
    public float f;
}

Since the classifier has no special knowledge of the concept of fixed buffers, the classifier marks the first four bytes as INTEGER, the next 8 as NO_CLASS, and the final four as SSE. This results in the second eightbyte being classified as SSE instead of INTEGER.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions