diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-30 01:56:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-30 01:56:53 +0000 |
commit | 0a9ed1014e3ccc2cf1cfe5854a581822a5de4195 (patch) | |
tree | d12dabf9c3e4ef4a635c2f0f73094a0ed7b4aed3 | |
parent | da9e16a52bb2523f5ff2f180e73b01e86c614870 (diff) | |
download | ruby-0a9ed1014e3ccc2cf1cfe5854a581822a5de4195.tar.gz |
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
-rw-r--r-- | vm_insnhelper.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 37e7637450..1d5c3a5d86 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -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 { |