JIT_TailCall helper has an implicit assumption that all tail call arguments live
authorEugene Rozenfeld <erozen@microsoft.com>
Thu, 2 Jun 2016 00:38:53 +0000 (17:38 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Thu, 2 Jun 2016 00:38:53 +0000 (17:38 -0700)
commit3a97871a149dc116c80710ff51ecc85f62763909
tree80dfc851925b0e51f8b0b267892e120d576168e2
parentc1cf38369531d9fb98a1b26166a1e48c0c8c808d
JIT_TailCall helper has an implicit assumption that all tail call arguments live

on the caller's frame. If an argument lives on the caller caller's frame, it may get
overwritten if that frame is reused for the tail call. Therefore, we should always copy
struct parameters if they are passed as arguments to a tail call.

The simple il regression test has a scenario similar to that of the F# repro in #5164.

Closes #5164.
src/jit/morph.cpp
tests/src/JIT/Regression/JitBlue/GitHub_5164/GitHub_5164.il [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_5164/GitHub_5164.ilproj [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_5164/app.config [new file with mode: 0644]