JIT: retype some return expressions
authorAndy Ayers <andya@microsoft.com>
Sat, 17 Nov 2018 18:26:25 +0000 (10:26 -0800)
committerAndy Ayers <andya@microsoft.com>
Tue, 27 Nov 2018 18:47:41 +0000 (10:47 -0800)
commit3bc2f7a800498135a1c1575b01d0f5d1113d9acd
tree93a92baed287c187658573f7c00df0d1b7a9d710
parent7f22a149708a9ad6a90b9a92b78c12a7f4ae9d41
JIT: retype some return expressions

The jit is fairly tolerant of byref/native int mismatches for inline arguments
and return values. And some of the new unsafe helpers do this kind of
reinterpretation across call boundaries as well. This sometimes leads the jit
to lose track of byrefs.

A general fix for this is likely somewhat involved. For now we simply detect if
we're about to lose track of a byref when substituting a particular kind of
return expression, and retype the expression to a byref.

Fixes #21051.
src/System.Private.CoreLib/shared/System/Globalization/CharUnicodeInfo.cs
src/jit/flowgraph.cpp