summaryrefslogtreecommitdiff
path: root/ext/-test-/recursion
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 /ext/-test-/recursion
parentf4747958e546a5d3f2c0033b19c6ad69ce7278b1 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6004
Diffstat (limited to 'ext/-test-/recursion')
-rw-r--r--ext/-test-/recursion/recursion.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/-test-/recursion/recursion.c b/ext/-test-/recursion/recursion.c
index 13d41f0ba8..c9935f2de2 100644
--- a/ext/-test-/recursion/recursion.c
+++ b/ext/-test-/recursion/recursion.c
@@ -16,7 +16,7 @@ exec_recursive(VALUE self, VALUE mid)
static VALUE
exec_recursive_outer(VALUE self, VALUE mid)
{
- return rb_exec_recursive_outer(recursive_i, self, mid);
+ return rb_exec_recursive_outer_mid(recursive_i, self, mid, rb_intern("exec_recursive_outer"));
}
void