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

ruby-changes:49323

From: nagachika <ko1@a...>
Date: Sun, 24 Dec 2017 12:01:41 +0900 (JST)
Subject: [ruby-changes:49323] nagachika:r61440 (ruby_2_4): merge revision(s) 60024: [Backport #13945]

nagachika	2017-12-24 12:01:35 +0900 (Sun, 24 Dec 2017)

  New Revision: 61440

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

  Log:
    merge revision(s) 60024: [Backport #13945]
    
    vm.c: fetch retval iff necessary
    
    * vm.c (rb_vm_make_jump_tag_but_local_jump): get rid of fetching
      retval when it is not used.  it is necessary for local jump
      state only.

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/load.c
    branches/ruby_2_4/version.h
    branches/ruby_2_4/vm.c
Index: ruby_2_4/load.c
===================================================================
--- ruby_2_4/load.c	(revision 61439)
+++ ruby_2_4/load.c	(revision 61440)
@@ -626,6 +626,8 @@ rb_load_internal0(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_4/load.c#L626
     th->top_wrapper = wrapper;
 
     if (state) {
+	/* usually state == TAG_RAISE only, except for
+	 * rb_iseq_load_iseq case */
 	VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);
 	if (NIL_P(exc)) return state;
 	th->errinfo = exc;
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 61439)
+++ ruby_2_4/version.h	(revision 61440)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.4"
 #define RUBY_RELEASE_DATE "2017-12-24"
-#define RUBY_PATCHLEVEL 222
+#define RUBY_PATCHLEVEL 223
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 12
Index: ruby_2_4/vm.c
===================================================================
--- ruby_2_4/vm.c	(revision 61439)
+++ ruby_2_4/vm.c	(revision 61440)
@@ -1398,33 +1398,33 @@ rb_vm_localjump_error(const char *mesg, https://github.com/ruby/ruby/blob/trunk/ruby_2_4/vm.c#L1398
 VALUE
 rb_vm_make_jump_tag_but_local_jump(int state, VALUE val)
 {
-    VALUE result = Qnil;
+    const char *mesg;
 
-    if (val == Qundef) {
-	val = GET_THREAD()->tag->retval;
-    }
     switch (state) {
-      case 0:
-	break;
       case TAG_RETURN:
-	result = make_localjump_error("unexpected return", val, state);
+	mesg = "unexpected return";
 	break;
       case TAG_BREAK:
-	result = make_localjump_error("unexpected break", val, state);
+	mesg = "unexpected break";
 	break;
       case TAG_NEXT:
-	result = make_localjump_error("unexpected next", val, state);
+	mesg = "unexpected next";
 	break;
       case TAG_REDO:
-	result = make_localjump_error("unexpected redo", Qnil, state);
+	mesg = "unexpected redo";
+	val = Qnil;
 	break;
       case TAG_RETRY:
-	result = make_localjump_error("retry outside of rescue clause", Qnil, state);
+	mesg = "retry outside of rescue clause";
+	val = Qnil;
 	break;
       default:
-	break;
+	return Qnil;
+    }
+    if (val == Qundef) {
+	val = GET_THREAD()->tag->retval;
     }
-    return result;
+    return make_localjump_error(mesg, val, state);
 }
 
 void
Index: ruby_2_4
===================================================================
--- ruby_2_4	(revision 61439)
+++ ruby_2_4	(revision 61440)

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r60024

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

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