diff options
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -6387,7 +6387,11 @@ snode(INSTRUCTION *subn, INSTRUCTION *r) subn->lasti->assign_ctxt = Op_sub_builtin; subn->lasti->field_assign = (Func_ptr) 0; ip->target_assign = subn->lasti; + } else if (ip->opcode == Op_subscript_lhs) { + (void) list_append(subn, instruction(Op_subscript_assign)); + subn->lasti->assign_ctxt = Op_sub_builtin; } + return subn; } else { @@ -7553,6 +7557,8 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op) (void) list_append(ip, instruction(Op_field_assign)); ip->lasti->field_assign = (Func_ptr) 0; tp->target_assign = ip->lasti; + } else if (tp->opcode == Op_subscript_lhs) { + (void) list_append(ip, instruction(Op_subscript_assign)); } return ip; @@ -7762,7 +7768,11 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype) asgn->assign_ctxt = op->opcode; asgn->field_assign = (Func_ptr) 0; /* determined at run time */ tp->target_assign = asgn; + } else if (tp->opcode == Op_subscript_lhs) { + asgn = instruction(Op_subscript_assign); + asgn->assign_ctxt = op->opcode; } + if (redir != NULL) { ip = list_merge(redir, var); (void) list_append(ip, op); |