Description
#61938 exposed this issue.
We had other issues that could cause related test scenario (TestGenericMDArrayBehavior
) to never run in R2R mode on OSX.
#61938 makes R2R enabled more reliably on OSX, but now we see the test failing, so I disabled the scenario as a part of #61938.
I beleive the root cause is variadic JIT helper - HCIMPL2VA(Object*, JIT_NewMDArr, CORINFO_CLASS_HANDLE classHnd, unsigned dwNumArgs)
.
It looks like OSX/ARM64 has special ABI for variadic calls, but we call it just as a cdecl with extra arguments. As a result the helper reads garbage and allocating MD arrays fails.
We do not use this helper in regular JIT code. There is a comment that it may be worth switching R2R to non-variadic helper as well since it would be more portable. Perhaps it is time?