[前][次][番号順一覧][スレッド一覧]

ruby-changes:33759

From: nobu <ko1@a...>
Date: Tue, 6 May 2014 17:54:40 +0900 (JST)
Subject: [ruby-changes:33759] nobu:r45840 (trunk): eval.c: method name

nobu	2014-05-06 17:54:36 +0900 (Tue, 06 May 2014)

  New Revision: 45840

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45840

  Log:
    eval.c: method name
    
    * eval.c (setup_exception): add the method name to system stack
      error message.

  Modified files:
    trunk/eval.c
Index: eval.c
===================================================================
--- eval.c	(revision 45839)
+++ eval.c	(revision 45840)
@@ -487,7 +487,12 @@ setup_exception(rb_thread_t *th, int tag https://github.com/ruby/ruby/blob/trunk/eval.c#L487
     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);
 	}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]