Skip to content

Commit f2b38f8

Browse files
committed
Add missing ENREGISTERED_PARAMTYPE_MAXSIZE condition to C# version of FpStruct info calculation
1 parent a229831 commit f2b38f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using ILCompiler;
77
using Internal.TypeSystem;
88
using static Internal.JitInterface.FpStruct;
9-
using static Internal.JitInterface.StructFloatFieldInfoFlags;
109

1110
namespace Internal.JitInterface
1211
{
@@ -144,6 +143,9 @@ TypeFlags.Array or
144143

145144
public static FpStructInRegistersInfo GetRiscV64PassFpStructInRegistersInfo(TypeDesc td)
146145
{
146+
if (td.GetElementSize().AsInt > ENREGISTERED_PARAMTYPE_MAXSIZE)
147+
return new FpStructInRegistersInfo{};
148+
147149
FpStructInRegistersInfo info = new FpStructInRegistersInfo{};
148150
int nFields = 0;
149151
if (!FlattenFields(td, 0, ref info, ref nFields))

0 commit comments

Comments
 (0)