[ARM/Linux] Fix incorrect return marshaling in PInvoke stub (#5010)
authorJonghyun Park <parjong@gmail.com>
Wed, 25 May 2016 02:23:51 +0000 (11:23 +0900)
committerJan Kotas <jkotas@microsoft.com>
Wed, 25 May 2016 02:23:51 +0000 (19:23 -0700)
commitbcc8495653c03b8ba4bb61fbd4828cac90789c4e
tree4dc3710049208d0061e71e87eae73e0a53e69e40
parent31031a3e21e6cbe227b99d9febcfaa554a8774d1
[ARM/Linux] Fix incorrect return marshaling in PInvoke stub (#5010)

* Revises compMethodReturnsMultiRegRetType for ARM

For ARM, the current implementation of 'compMethodReturnsMultiRegRetType'
always returns false.

Unfortunately, this behavior is inconsistent with JIT importer. JIT impoter
attempts to merge various return statements as one statement via inserting
an assignment statement just before each return statement if there are more
than 4 returns.

If the method of interest has a return value, then JIT importer
introduces a local temporary variable, and use it to return value.

Due to the above implementation, JIT importer never generates a return
variable, which results in assertion violation insider JIT morph, which
is discussed in #5009.

This commit attempts to fix #5009 via implementing 'compMethodReturnsMultiRegRetType'
for ARM.

* Uses compRetNativeType instead of compRetType

* Fix typo '_TARGET_ARM' as '_TARGET_ARM_'
src/jit/compiler.h
src/vm/ilmarshalers.h