Skip to content

Commit

Permalink
[LoongArch64] Fix some errors of the struct argument parsing in Loong…
Browse files Browse the repository at this point in the history
…Arch64PassStructInRegister.cs (#98744)
  • Loading branch information
LuckyXu-HF committed Feb 26, 2024
1 parent 1a0e610 commit 5ef47c8
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ public static uint GetLoongArch64PassStructInRegisterFlags(TypeDesc typeDesc)
int fieldIndex = 0;
foreach (FieldDesc field in typeDesc.GetFields())
{
if (fieldIndex > 1)
{
return (uint)StructFloatFieldInfoFlags.STRUCT_NO_FLOAT_FIELD;
}
else if (field.IsStatic)
if (field.IsStatic)
{
continue;
}
Expand Down Expand Up @@ -162,6 +158,11 @@ public static uint GetLoongArch64PassStructInRegisterFlags(TypeDesc typeDesc)

default:
{
if ((numIntroducedFields == 2) && (field.FieldType.Category == TypeFlags.Class))
{
return (uint)StructFloatFieldInfoFlags.STRUCT_NO_FLOAT_FIELD;
}

if (field.FieldType.GetElementSize().AsInt == 8)
{
if (numIntroducedFields > 1)
Expand Down

0 comments on commit 5ef47c8

Please sign in to comment.