From d03eabd52010b25e7a53c832792338ebe6ce2ead Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 6 May 2014 08:54:36 +0000 Subject: eval.c: method name * eval.c (setup_exception): add the method name to system stack error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 35397c2741..a7c5322567 100644 --- a/eval.c +++ b/eval.c @@ -487,7 +487,12 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause) if (file) line = rb_sourceline(); if (file && !NIL_P(mesg)) { if (mesg == sysstack_error) { + ID func = rb_frame_this_func(); at = rb_enc_sprintf(rb_usascii_encoding(), "%s:%d", file, line); + if (func) { + VALUE name = rb_id2str(func); + if (name) rb_str_catf(at, ":in `%"PRIsVALUE"'", name); + } at = rb_ary_new3(1, at); rb_iv_set(mesg, "bt", at); } -- cgit v1.2.3