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

ruby-changes:34450

From: naruse <ko1@a...>
Date: Tue, 24 Jun 2014 06:21:07 +0900 (JST)
Subject: [ruby-changes:34450] naruse:r46531 (trunk): * eval.c (setup_exception): "mesg == sysstack_error" and

naruse	2014-06-24 06:21:00 +0900 (Tue, 24 Jun 2014)

  New Revision: 46531

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

  Log:
    * eval.c (setup_exception): "mesg == sysstack_error" and
      sysstack_error_p(mesg) are duplicated.
      r46502 seems to want to use latter.

  Modified files:
    trunk/ChangeLog
    trunk/eval.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46530)
+++ ChangeLog	(revision 46531)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jun 24 06:17:52 2014  NARUSE, Yui  <naruse@r...>
+
+	* eval.c (setup_exception): "mesg == sysstack_error" and
+	  sysstack_error_p(mesg) are duplicated.
+	  r46502 seems to want to use latter.
+
 Tue Jun 24 06:15:36 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/tk/tcltklib.c: fix format specifiers for VALUE and
Index: eval.c
===================================================================
--- eval.c	(revision 46530)
+++ eval.c	(revision 46531)
@@ -492,25 +492,13 @@ setup_exception(rb_thread_t *th, int tag https://github.com/ruby/ruby/blob/trunk/eval.c#L492
     file = rb_sourcefile();
     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);
-	}
-	else {
-	    if (sysstack_error_p(mesg) || NIL_P(at = get_backtrace(mesg))) {
-		at = rb_vm_backtrace_object();
-		if (OBJ_FROZEN(mesg)) {
-		    mesg = rb_obj_dup(mesg);
-		}
-		rb_iv_set(mesg, "bt_locations", at);
-		set_backtrace(mesg, at);
+	if (sysstack_error_p(mesg) || NIL_P(at = get_backtrace(mesg))) {
+	    at = rb_vm_backtrace_object();
+	    if (OBJ_FROZEN(mesg)) {
+		mesg = rb_obj_dup(mesg);
 	    }
+	    rb_iv_set(mesg, "bt_locations", at);
+	    set_backtrace(mesg, at);
 	}
     }
 

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

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