@@ -2878,6 +2878,37 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
2878
2878
nonStandardArgs.Add(arg1, REG_PINVOKE_FRAME);
2879
2879
}
2880
2880
#endif // defined(_TARGET_X86_) || defined(_TARGET_ARM_)
2881
+ #if defined(_TARGET_ARM_)
2882
+ else if (call->gtCallMoreFlags & GTF_CALL_M_SECURE_DELEGATE_INV)
2883
+ {
2884
+ GenTree* arg = call->gtCallObjp;
2885
+ if (arg->OperIsLocal())
2886
+ {
2887
+ arg = gtClone(arg, true);
2888
+ }
2889
+ else
2890
+ {
2891
+ GenTree* tmp = fgInsertCommaFormTemp(&arg);
2892
+ call->gtCallObjp = arg;
2893
+ call->gtFlags |= GTF_ASG;
2894
+ arg = tmp;
2895
+ }
2896
+ noway_assert(arg != nullptr);
2897
+
2898
+ GenTree* newArg = new (this, GT_ADDR)
2899
+ GenTreeAddrMode(TYP_REF, arg, nullptr, 0, eeGetEEInfo()->offsetOfSecureDelegateIndirectCell);
2900
+
2901
+ // Append newArg as the last arg
2902
+ GenTreeArgList** insertionPoint = &call->gtCallArgs;
2903
+ for (; *insertionPoint != nullptr; insertionPoint = &(*insertionPoint)->Rest())
2904
+ {
2905
+ }
2906
+ *insertionPoint = gtNewListNode(newArg, nullptr);
2907
+
2908
+ numArgs++;
2909
+ nonStandardArgs.Add(newArg, virtualStubParamInfo->GetReg());
2910
+ }
2911
+ #endif // defined(_TARGET_ARM_)
2881
2912
#if defined(_TARGET_X86_)
2882
2913
// The x86 shift helpers have custom calling conventions and expect the lo part of the long to be in EAX and the
2883
2914
// hi part to be in EDX. This sets the argument registers up correctly.
0 commit comments