The type of the ADDR node needs to be set to TYP_BYREF for arm64.
For x64/ux, oddly, it requires the struct type. I added a TODO-Cleanu8p
comment because a GT_ADDR should never be TYP_STRUCT.
Commit migrated from https://github.com/dotnet/coreclr/commit/
1ca8b494fe38145f04753adc341d965f2bb328d6
}
else
{
- arg = gtNewOperNode(GT_ADDR, type, arg);
+#ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING
+ // TODO-Cleanup: Fix this - we should never have an address that is TYP_STRUCT.
+ var_types addrType = type;
+#else
+ var_types addrType = TYP_BYREF;
+#endif
+ arg = gtNewOperNode(GT_ADDR, addrType, arg);
addrNode = arg;
#if FEATURE_MULTIREG_ARGS