diff --git a/src/asm/fstack.c b/src/asm/fstack.c index c1f8a084..0a8cf5f1 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -258,6 +258,8 @@ void fstk_RunRept(uint32_t count, int32_t nReptLineNo, char *body, size_t size) { dbgPrint("Running REPT(%" PRIu32 ")\n", count); + if (count == 0) + return; uint32_t reptDepth = contextStack->reptDepth; newContext(reptDepth + 1); diff --git a/test/asm/rept-0.asm b/test/asm/rept-0.asm new file mode 100644 index 00000000..13a52a69 --- /dev/null +++ b/test/asm/rept-0.asm @@ -0,0 +1,3 @@ +REPT 0 + WARN "2" +ENDR diff --git a/test/asm/rept-0.err b/test/asm/rept-0.err new file mode 100644 index 00000000..e69de29b diff --git a/test/asm/rept-0.out b/test/asm/rept-0.out new file mode 100644 index 00000000..e69de29b