From f71413d42b501b4e5ebd3558fc9d8644da3fc68e Mon Sep 17 00:00:00 2001 From: Koichi Nakamura Date: Tue, 5 Jan 2021 21:34:06 +0900 Subject: [PATCH] fixed a bug of do-loop --- bootstrap.fs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bootstrap.fs b/bootstrap.fs index 0c25e46..c7e6532 100644 --- a/bootstrap.fs +++ b/bootstrap.fs @@ -1723,9 +1723,15 @@ do-stack 16 cells + do-sp ! \ compile: ( -- dest mark ) : do + compile 2dup compile >r \ save start compile >r \ save limit + \ leave if start >= limit + compile > + compile 0branch + 0 , here >do do-mark >do + here cell- >do leave-mark >do ; immediate : leave ( -- orig mark )