1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
* vm_exec.h (VM_SP_CNT): accepts `ec` instead of `th`.

* vm_insnhelper.c (vm_stack_consistency_error): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-10-27 05:33:33 +00:00
parent 7267a79a7f
commit f37049ec05
3 changed files with 6 additions and 6 deletions

View file

@ -990,7 +990,7 @@ leave
if (OPT_CHECKED_RUN) { if (OPT_CHECKED_RUN) {
const VALUE *const bp = vm_base_ptr(reg_cfp); const VALUE *const bp = vm_base_ptr(reg_cfp);
if (reg_cfp->sp != bp) { if (reg_cfp->sp != bp) {
vm_stack_consistency_error(th, reg_cfp, bp); vm_stack_consistency_error(th->ec, reg_cfp, bp);
} }
} }

View file

@ -157,7 +157,7 @@ default: \
#endif #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 #if OPT_CALL_THREADED_CODE
#define THROW_EXCEPTION(exc) do { \ #define THROW_EXCEPTION(exc) do { \

View file

@ -3326,16 +3326,16 @@ vm_case_dispatch(CDHASH hash, OFFSET else_offset, VALUE key)
} }
NORETURN(static void 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 rb_control_frame_t *,
const VALUE *)); const VALUE *));
static void 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 rb_control_frame_t *cfp,
const VALUE *bp) const VALUE *bp)
{ {
const ptrdiff_t nsp = VM_SP_CNT(th, cfp->sp); const ptrdiff_t nsp = VM_SP_CNT(ec, cfp->sp);
const ptrdiff_t nbp = VM_SP_CNT(th, bp); const ptrdiff_t nbp = VM_SP_CNT(ec, bp);
static const char stack_consistency_error[] = static const char stack_consistency_error[] =
"Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")"; "Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")";
#if defined RUBY_DEVEL #if defined RUBY_DEVEL