Skip to content

Commit 4b11a2e

Browse files
Disallow ASG(..., IND<struct>) before morph (#74715)
* Delete IND<struct> handling from local morph * Fix raw handle intrinsics
1 parent ba0778a commit 4b11a2e

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

src/coreclr/jit/importer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3889,8 +3889,14 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
38893889
GenTree* lclVar = gtNewLclvNode(rawHandleSlot, TYP_I_IMPL);
38903890
GenTree* lclVarAddr = gtNewOperNode(GT_ADDR, TYP_I_IMPL, lclVar);
38913891
var_types resultType = JITtype2varType(sig->retType);
3892-
retNode = gtNewOperNode(GT_IND, resultType, lclVarAddr);
3893-
3892+
if (resultType == TYP_STRUCT)
3893+
{
3894+
retNode = gtNewObjNode(sig->retTypeClass, lclVarAddr);
3895+
}
3896+
else
3897+
{
3898+
retNode = gtNewIndir(resultType, lclVarAddr);
3899+
}
38943900
break;
38953901
}
38963902

src/coreclr/jit/lclmorph.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,19 +1015,6 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
10151015
return IndirTransform::None;
10161016
}
10171017

1018-
if (indir->OperIs(GT_IND)) // IND<struct>
1019-
{
1020-
// TODO-ADDR: add this case to the "don't expect" assert above; it requires updating
1021-
// "cpblk" import to not create such nodes for block copies of known size.
1022-
return IndirTransform::None;
1023-
}
1024-
1025-
if (!user->OperIs(GT_ASG, GT_CALL, GT_RETURN))
1026-
{
1027-
// TODO-ADDR: define the contract for "COMMA(..., LCL<struct>)".
1028-
return IndirTransform::None;
1029-
}
1030-
10311018
ClassLayout* indirLayout = nullptr;
10321019

10331020
if (indir->OperIs(GT_FIELD))

0 commit comments

Comments
 (0)