summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2022-06-10 09:43:05 -0700
committerJohn Hawthorn <john@hawthorn.email>2022-06-10 14:48:21 -0700
commit52da90aceefd9f8de06666796f6a2d484ca18036 (patch)
tree2f09ab04c73ca979dd9561c36e0e51f184fac5af /thread.c
parentf4747958e546a5d3f2c0033b19c6ad69ce7278b1 (diff)
downloadruby-52da90aceefd9f8de06666796f6a2d484ca18036.tar.gz
Make method id explicit in rb_exec_recursive_outer
Previously, because opt_aref and opt_aset don't push a frame, when they would call rb_hash to determine the hash value of the key, the initial level of recursion would incorrectly use the method id at the top of the stack instead of "hash". This commit replaces rb_exec_recursive_outer with rb_exec_recursive_outer_mid, which takes an explicit method id, so that we can make the hash calculation behave consistently. rb_exec_recursive_outer was documented as being internal, so I believe this should be okay to change.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index 1295823cb3..5e659a643f 100644
--- a/thread.c
+++ b/thread.c
@@ -5158,9 +5158,9 @@ rb_exec_recursive_paired(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pai
*/
VALUE
-rb_exec_recursive_outer(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg)
+rb_exec_recursive_outer_mid(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg, ID mid)
{
- return exec_recursive(func, obj, 0, arg, 1, rb_frame_last_func());
+ return exec_recursive(func, obj, 0, arg, 1, mid);
}
/*