[release/6.0] Fix crossgen2 calli GC hole by unifying MethodDesc/MethodSignature...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fri, 3 Sep 2021 18:30:37 +0000 (11:30 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Sep 2021 18:30:37 +0000 (11:30 -0700)
commit69b137ab85f0363f365074fe9bf6abb3c52d152f
treedd781274ef935c2a43394d7bffd551acc3277a46
parentda89cc752bbedfdbc9d42f2f4b1098f388892709
[release/6.0] Fix crossgen2 calli GC hole by unifying MethodDesc/MethodSignature IsMarshallingRequired logic (#58609)

* Unify MethodDesc/MethodSignature IsMarshallingRequired logic

For unmanaged calli crossgen2 was not properly checking all necessary
conditions for a pinvoke being required. In particular it did not check
for managed byrefs. Unify the MethodDesc/MethodSignature logic to get
all the checks.

Fix #58259

* Add a simple regression test

* Fix test build

Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com>
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Interop/IL/Marshaller.ReadyToRun.cs
src/tests/JIT/Regression/JitBlue/Runtime_58259/Runtime_58259.cs [new file with mode: 0644]
src/tests/JIT/Regression/JitBlue/Runtime_58259/Runtime_58259.csproj [new file with mode: 0644]