diff --git a/insns.def b/insns.def index 3044ccd71f..94d28be37c 100644 --- a/insns.def +++ b/insns.def @@ -990,7 +990,7 @@ leave if (OPT_CHECKED_RUN) { const VALUE *const bp = vm_base_ptr(reg_cfp); if (reg_cfp->sp != bp) { - vm_stack_consistency_error(th, reg_cfp, bp); + vm_stack_consistency_error(th->ec, reg_cfp, bp); } } diff --git a/vm_exec.h b/vm_exec.h index e44ed1bbaf..1991172bd8 100644 --- a/vm_exec.h +++ b/vm_exec.h @@ -157,7 +157,7 @@ default: \ #endif -#define VM_SP_CNT(th, sp) ((sp) - (th)->ec->vm_stack) +#define VM_SP_CNT(ec, sp) ((sp) - (ec)->vm_stack) #if OPT_CALL_THREADED_CODE #define THROW_EXCEPTION(exc) do { \ diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6c841bf55a..251102b6f6 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -3326,16 +3326,16 @@ vm_case_dispatch(CDHASH hash, OFFSET else_offset, VALUE key) } NORETURN(static void - vm_stack_consistency_error(rb_thread_t *, + vm_stack_consistency_error(const rb_execution_context_t *ec, const rb_control_frame_t *, const VALUE *)); static void -vm_stack_consistency_error(rb_thread_t *th, +vm_stack_consistency_error(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE *bp) { - const ptrdiff_t nsp = VM_SP_CNT(th, cfp->sp); - const ptrdiff_t nbp = VM_SP_CNT(th, bp); + const ptrdiff_t nsp = VM_SP_CNT(ec, cfp->sp); + const ptrdiff_t nbp = VM_SP_CNT(ec, bp); static const char stack_consistency_error[] = "Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")"; #if defined RUBY_DEVEL