From 43ceedecc0b9990b5bac2e65de5e439c41a9996b Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@atdot.net>
Date: Sat, 9 Nov 2019 16:15:17 +0900
Subject: use STACK_ADDR_FROM_TOP()

vm_invoke_builtin() accesses VM stack via cfp->sp. However, MJIT
can use their own stack. To access them appropriately, we need to
use STACK_ADDR_FROM_TOP().
---
 insns.def | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index 993bc047ee..1333c09869 100644
--- a/insns.def
+++ b/insns.def
@@ -1497,7 +1497,7 @@ invokebuiltin
 // attr bool leaf = false; /* anything can happen inside */
 // attr rb_snum_t sp_inc = 1 - bf->argc;
 {
-    ret = vm_invoke_builtin(ec, reg_cfp, bf);
+    ret = vm_invoke_builtin(ec, reg_cfp, bf, STACK_ADDR_FROM_TOP(bf->argc));
 }
 
 /* call specific function with args (same parameters) */
-- 
cgit v1.2.3

