Skip to content

Commit 5ef47c8

Browse files
authored
[LoongArch64] Fix some errors of the struct argument parsing in LoongArch64PassStructInRegister.cs (#98744)
1 parent 1a0e610 commit 5ef47c8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/coreclr/tools/Common/JitInterface/LoongArch64PassStructInRegister.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ public static uint GetLoongArch64PassStructInRegisterFlags(TypeDesc typeDesc)
5555
int fieldIndex = 0;
5656
foreach (FieldDesc field in typeDesc.GetFields())
5757
{
58-
if (fieldIndex > 1)
59-
{
60-
return (uint)StructFloatFieldInfoFlags.STRUCT_NO_FLOAT_FIELD;
61-
}
62-
else if (field.IsStatic)
58+
if (field.IsStatic)
6359
{
6460
continue;
6561
}
@@ -162,6 +158,11 @@ public static uint GetLoongArch64PassStructInRegisterFlags(TypeDesc typeDesc)
162158

163159
default:
164160
{
161+
if ((numIntroducedFields == 2) && (field.FieldType.Category == TypeFlags.Class))
162+
{
163+
return (uint)StructFloatFieldInfoFlags.STRUCT_NO_FLOAT_FIELD;
164+
}
165+
165166
if (field.FieldType.GetElementSize().AsInt == 8)
166167
{
167168
if (numIntroducedFields > 1)

0 commit comments

Comments
 (0)