JIT: retype byrefs passed to unmanaged callers as native int (#39105)
authorAndy Ayers <andya@microsoft.com>
Sat, 11 Jul 2020 17:37:06 +0000 (10:37 -0700)
committerGitHub <noreply@github.com>
Sat, 11 Jul 2020 17:37:06 +0000 (10:37 -0700)
commit4d4dce5c75576eccdd3d6fb0105fc2ad457ae67a
treedf9f310f4fae98ac1eea5bb5a8adb0e5e6fc0dc6
parentbaeae95883f3b7de3b8782ba4718707aa6f3f7e1
JIT: retype byrefs passed to unmanaged callers as native int (#39105)

Make the jit more robust in cases where the IL producer is passing a byref
to an unmanaged caller, by retyping the argument as native int.

Allows the jit to produce self-consistent GC info and avoid the issues
seen in #34279, at least for byrefs.

Closes #39040.
src/coreclr/src/jit/importer.cpp