[interp] Fix vtype ldfld from another vtype (#8496)
commit4a5a668c514424549a6b7fbb870780850e30828f
authorVlad Brezae <brezaevlad@gmail.com>
Mon, 30 Apr 2018 12:44:18 +0000 (30 15:44 +0300)
committerLudovic Henry <luhenry@microsoft.com>
Mon, 30 Apr 2018 12:44:18 +0000 (30 08:44 -0400)
tree9d1db9b35c489f0a78afd3bad5233e965fa43054
parent632a9299621e63922a1fe0f7fcae02c17d518857
[interp] Fix vtype ldfld from another vtype (#8496)

CEE_LDFLD replaces at the top of the stack the object/valuetype one of its fields. MINT_LDFLD_VT loads a valuetype field from the object/valuetype at the top of the stack. When loading a field from a valuetype, at the end we also did a MINT_VTRESULT to pop the vtspace. If previously we were loading also a valuetype, then, when popping the original valuetype, we discard memory from the loaded field. With this change, we use 2 MINT_VTRESULT, one to pop the loaded field and second to copy it in place of the original valuetype.
mono/mini/interp/transform.c
mono/tests/Makefile.am
mono/tests/ldfldvt.il [new file with mode: 0644]