ARM32: fix interface dispatch cell address transfer
authorPetr Bred <bredpetr@gmail.com>
Wed, 20 Sep 2017 17:52:05 +0000 (20:52 +0300)
committerPetr Bred <bredpetr@gmail.com>
Wed, 27 Sep 2017 10:06:55 +0000 (13:06 +0300)
Signed-off-by: Petr Bred <bredpetr@gmail.com>
src/jit/lower.cpp

index 05dcd08..59c64e6 100644 (file)
@@ -3803,7 +3803,12 @@ GenTree* Lowering::LowerVirtualStubCall(GenTreeCall* call)
             // on x64 we must materialize the target using specific registers.
             addr->gtRegNum = comp->virtualStubParamInfo->GetReg();
 
+// On ARM we must use a proper address in R12(thunk register) without dereferencing.
+// So for the jump we use the default register.
+// TODO: specifying register probably unnecessary for other platforms, too.
+#if !defined(_TARGET_UNIX_) && !defined(_TARGET_ARM_)
             indir->gtRegNum = REG_JUMP_THUNK_PARAM;
+#endif
             indir->gtFlags |= GTF_IND_REQ_ADDR_IN_REG;
 #endif
             result = indir;