Skip to content

NativeAOT can report wrong sizes of native structs #75666

@MichalStrehovsky

Description

@MichalStrehovsky

Like the comment says.

// IsBlittable() checks whether the type contains GC references. It is approximate check with false positives.
// This fallback path will return incorrect answer for types that do not contain GC references, but that are
// not actually blittable; e.g. for types with bool fields.
if (structureTypeHandle.IsBlittable() && structureTypeHandle.IsValueType())
{
return structureTypeHandle.GetValueTypeSize();
}

I'm putting this into Future milestone. We should be able to delete this logic because in theory there should be AOT analysis warnings whenever this API can be problematic and then we're allowed to potentially throw. In practice, deleting this fails many tests and I don't want to deal with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-coreclrin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions