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

ruby-changes:72125

From: John <ko1@a...>
Date: Sat, 11 Jun 2022 06:48:36 +0900 (JST)
Subject: [ruby-changes:72125] f4747958e5 (master): Add mid argument to exec_recursive

https://git.ruby-lang.org/ruby.git/commit/?id=f4747958e5

From f4747958e546a5d3f2c0033b19c6ad69ce7278b1 Mon Sep 17 00:00:00 2001
From: John Hawthorn <john@h...>
Date: Wed, 8 Jun 2022 15:21:42 -0700
Subject: Add mid argument to exec_recursive

---
 thread.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/thread.c b/thread.c
index 26c46ed9de..1295823cb3 100644
--- a/thread.c
+++ b/thread.c
@@ -5070,10 +5070,9 @@ exec_recursive_i(RB_BLOCK_CALL_FUNC_ARGLIST(tag, data)) https://github.com/ruby/ruby/blob/trunk/thread.c#L5070
  */
 
 static VALUE
-exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE arg, int outer)
+exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE arg, int outer, ID mid)
 {
     VALUE result = Qundef;
-    const ID mid = rb_frame_last_func();
     const VALUE sym = mid ? ID2SYM(mid) : ID2SYM(idNULL);
     struct exec_recursive_params p;
     int outermost;
@@ -5138,7 +5137,7 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE https://github.com/ruby/ruby/blob/trunk/thread.c#L5137
 VALUE
 rb_exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg)
 {
-    return exec_recursive(func, obj, 0, arg, 0);
+    return exec_recursive(func, obj, 0, arg, 0, rb_frame_last_func());
 }
 
 /*
@@ -5149,7 +5148,7 @@ rb_exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg) https://github.com/ruby/ruby/blob/trunk/thread.c#L5148
 VALUE
 rb_exec_recursive_paired(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE paired_obj, VALUE arg)
 {
-    return exec_recursive(func, obj, rb_memory_id(paired_obj), arg, 0);
+    return exec_recursive(func, obj, rb_memory_id(paired_obj), arg, 0, rb_frame_last_func());
 }
 
 /*
@@ -5161,7 +5160,7 @@ rb_exec_recursive_paired(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pai https://github.com/ruby/ruby/blob/trunk/thread.c#L5160
 VALUE
 rb_exec_recursive_outer(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg)
 {
-    return exec_recursive(func, obj, 0, arg, 1);
+    return exec_recursive(func, obj, 0, arg, 1, rb_frame_last_func());
 }
 
 /*
@@ -5173,7 +5172,7 @@ rb_exec_recursive_outer(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg) https://github.com/ruby/ruby/blob/trunk/thread.c#L5172
 VALUE
 rb_exec_recursive_paired_outer(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE paired_obj, VALUE arg)
 {
-    return exec_recursive(func, obj, rb_memory_id(paired_obj), arg, 1);
+    return exec_recursive(func, obj, rb_memory_id(paired_obj), arg, 1, rb_frame_last_func());
 }
 
 /*
-- 
cgit v1.2.1


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

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