Skip to content

Commit e41a254

Browse files
committed
ATRONIX/FIX: Fix foreach with set-word
Without this commit, this causes a busy loop: >> foreach [a:] [1 2 3][ print mold a] Fixes: metaeducation/rebol-issues#1751 (cherry picked from commit d4b5163)
1 parent 4966f0b commit e41a254

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/n-loop.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
else SET_NONE(vars);
402402
}
403403

404-
// var spec is WORD:
404+
// var spec is SET_WORD:
405405
else if (IS_SET_WORD(words)) {
406406
if (ANY_OBJECT(value) || IS_MAP(value)) {
407407
*vars = *value;
@@ -414,6 +414,7 @@
414414
}
415415
else Trap_Arg(words);
416416
}
417+
if (index == rindex) index++; //the word block has only set-words: foreach [a:] [1 2 3][]
417418

418419
ds = Do_Blk(body, 0);
419420

0 commit comments

Comments
 (0)