Lock the the dest reg in `inst_RV_TT` if necessary.
authorPat Gavlin <pagavlin@microsoft.com>
Fri, 21 Jul 2017 23:43:25 +0000 (16:43 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Fri, 21 Jul 2017 23:43:25 +0000 (16:43 -0700)
commit1a70ba93318cf8081f7f433b793f03bc9c29e8b2
treef565771f4a2d92209079774e54d798cc3a53ce21
parent7b213c4c336383d281fcc3d3e7d811da54cb42ec
Lock the the dest reg in `inst_RV_TT` if necessary.

For ARM32, `inst_RV_TT` may need to load the referenced lclVar into a
temporary register before emitting the requested instruction. The
chosen register *must not* be the instruction's destination register.
The existing code attempted to ensure this by masking the dest register
from the set of pickable registers, but this is not sufficient:
`rsPickReg` must return a valid register and will happily attempt to
spill and return the destination register even if it is not in the
recommended set. To prevent this, this change locks and unlocks the
destination register if necessary (i.e. if it was not locked upon
entry).

Fixes #12935.
src/jit/instr.cpp