JIT: Fix OSR local detection for implicit byref promotion (#67678)
authorAndy Ayers <andya@microsoft.com>
Thu, 7 Apr 2022 15:13:47 +0000 (08:13 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Apr 2022 15:13:47 +0000 (08:13 -0700)
commit32a6620831f28e81f91a33fd09aba3476f43c09e
treea665ffccb6a832dd2b1098607b6825105fee313b
parent02f0b2135c7c559b35c4086655aa4f7d47a9ca4c
JIT: Fix OSR local detection for implicit byref promotion (#67678)

In #67247 I revised how the JIT determines if a local requires special
handling for OSR, but for implicit byrefs we may move locals for promoted
fields back and forth between parents and this messes with the new logic.
The fix is to reset the `lvIsOSRLocal` bit explicitly when creating the
fields for an implicit byref promotion.

Also added a bit of sanity checking to `lvaIsOSRLocal`.

Fixes #67488.
src/coreclr/jit/compiler.cpp
src/coreclr/jit/morph.cpp