Skip to content

Commit

Permalink
Remove compiler code to handle blocks in attrasgn
Browse files Browse the repository at this point in the history
Passing blocks is no longer allowed in attrasgn.  This is similar
to 3a674c9, but for attrasgn instead
of op_asgn.
  • Loading branch information
jeremyevans committed Apr 6, 2024
1 parent 0b4db71 commit ad90fdd
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions compile.c
Expand Up @@ -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));
Expand Down

0 comments on commit ad90fdd

Please sign in to comment.