1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vm_insnhelper.c: dump iseq

* vm_insnhelper.c (vm_stack_consistency_error): raise a fatal
  error with the disassembled instruction sequence, in the
  development version, instead of very rarely useful rb_bug in
  such case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-06-30 01:56:53 +00:00
parent 940fa3b824
commit 3bf4c46bb8

View file

@ -3325,7 +3325,14 @@ vm_stack_consistency_error(rb_thread_t *th,
const ptrdiff_t nbp = VM_SP_CNT(th, bp);
static const char stack_consistency_error[] =
"Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")";
#if defined RUBY_DEVEL
VALUE mesg = rb_sprintf(stack_consistency_error, nsp, nbp);
rb_str_cat_cstr(mesg, "\n");
rb_str_append(mesg, rb_iseq_disasm(cfp->iseq));
rb_exc_fatal(rb_exc_new3(rb_eFatal, mesg));
#else
rb_bug(stack_consistency_error, nsp, nbp);
#endif
}
enum binop_operands_type {