From ad90fdd24c55284deab8c24449bfd1113658afdf Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 4 Apr 2024 19:32:30 -0700 Subject: [PATCH] Remove compiler code to handle blocks in attrasgn Passing blocks is no longer allowed in attrasgn. This is similar to 3a674c9c655288b3e12ac1cff149ba4af08fd452, but for attrasgn instead of op_asgn. --- compile.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/compile.c b/compile.c index dfdbb8f644..d509957dac 100644 --- a/compile.c +++ b/compile.c @@ -9782,16 +9782,7 @@ compile_attrasgn(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node ADD_SEQ(ret, recv); ADD_SEQ(ret, args); - if (flag & VM_CALL_ARGS_BLOCKARG) { - ADD_INSN1(ret, node, topn, INT2FIX(1)); - if (flag & VM_CALL_ARGS_SPLAT) { - ADD_INSN1(ret, node, putobject, INT2FIX(-1)); - ADD_SEND_WITH_FLAG(ret, node, idAREF, INT2FIX(1), INT2FIX(asgnflag)); - } - ADD_INSN1(ret, node, setn, FIXNUM_INC(argc, 3)); - ADD_INSN (ret, node, pop); - } - else if (flag & VM_CALL_ARGS_SPLAT) { + if (flag & VM_CALL_ARGS_SPLAT) { ADD_INSN(ret, node, dup); ADD_INSN1(ret, node, putobject, INT2FIX(-1)); ADD_SEND_WITH_FLAG(ret, node, idAREF, INT2FIX(1), INT2FIX(asgnflag));