Skip to content

[U]Int128 alignment handling is in the wrong place #72206

Closed
@SingleAccretion

Description

@SingleAccretion

There is code here:

#if defined(UNIX_AMD64_ABI) || defined(TARGET_ARM64)
else if (strcmp(nameSpace, g_SystemNS) == 0)
{
EEClassLayoutInfo* pLayout = pClass->GetLayoutInfo();
// These types correspond to fundamental data types in the underlying ABIs:
// * Int128: __int128
// * UInt128: unsigned __int128
if ((strcmp(name, g_Int128Name) == 0) || (strcmp(name, g_UInt128Name) == 0))
{
pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 16; // sizeof(__int128)
}
}
#endif // UNIX_AMD64_ABI || TARGET_ARM64

Which is intended to handle the special alignment requirement of the type on Unix x64/ARM64.

However, this code is currently dead because it is in an if block under bmtGenerics->HasInstantiation() (i. e. the if only handles generic types).

@tannergooding

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions