diff options
author | Jean Boussier <[email protected]> | 2025-06-06 08:51:10 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-06-06 11:30:23 +0200 |
commit | 0cc41d3d39303e186e5037deba6910b15278f465 () | |
tree | 3f014069f5b9dc4cfc70efae1a4f3c11cfcb89af | |
parent | 5ac435dc345d81b78bac4c995fb2b3dc7cface68 (diff) |
proc.c: saves Binding#clone on copying ivars twice
Notes: Merged: https://.com/ruby/ruby/pull/13541
-rw-r--r-- | proc.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -298,10 +298,8 @@ rb_binding_alloc(VALUE klass) return obj; } - -/* :nodoc: */ static VALUE -binding_dup(VALUE self) { VALUE bindval = rb_binding_alloc(rb_cBinding); rb_binding_t *src, *dst; @@ -310,15 +308,21 @@ binding_dup(VALUE self) rb_vm_block_copy(bindval, &dst->block, &src->block); RB_OBJ_WRITE(bindval, &dst->pathobj, src->pathobj); dst->first_lineno = src->first_lineno; - return rb_obj_dup_setup(self, bindval); } /* :nodoc: */ static VALUE binding_clone(VALUE self) { - VALUE bindval = binding_dup(self); - return rb_obj_clone_setup(self, bindval, Qnil); } VALUE |