Skip to content

Commit

Permalink
FIX: REDUCE/into of non-block doesn't insert into target
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jun 8, 2018
1 parent f4c48b7 commit 6d14eea
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/core/n-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,17 +684,32 @@ enum {
/*
***********************************************************************/
{
if (IS_BLOCK(D_ARG(1))) {
REBSER *ser = VAL_SERIES(D_ARG(1));
REBCNT index = VAL_INDEX(D_ARG(1));
REBVAL *val = D_REF(5) ? D_ARG(6) : 0;
REBVAL *val = D_ARG(1);
REBVAL *into = D_REF(5) ? D_ARG(6) : 0;

if (IS_BLOCK(val)) {
REBSER *ser = VAL_SERIES(val);
REBCNT index = VAL_INDEX(val);

if (D_REF(2))
Reduce_Block_No_Set(ser, index, val);
Reduce_Block_No_Set(ser, index, into);
else if (D_REF(3))
Reduce_Only(ser, index, D_ARG(4), val);
Reduce_Only(ser, index, D_ARG(4), into);
else
Reduce_Block(ser, index, val);
Reduce_Block(ser, index, into);
return R_TOS;
}
else if (into != 0) {
REBINT start = DSP + 1;
if (IS_WORD(val)) {
val = Get_Var(val);
DS_PUSH(val);
}
else if (IS_PATH(val)) {
Do_Path(&val, 0); // pushes val on stack
}
else DS_PUSH(val);
Copy_Stack_Values(start, into);
return R_TOS;
}

Expand Down

0 comments on commit 6d14eea

Please sign in to comment.