diff --git a/asm/preproc.c b/asm/preproc.c index 790cf73c..3ee36c10 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -3986,7 +3986,7 @@ issue_error: break; if (l) - l->finishes->in_progress = 1; + l->finishes->in_progress = 0; else nasm_nonfatal("`%%exitrep' not within `%%rep' block"); break; diff --git a/test/exitrep.asm b/test/exitrep.asm new file mode 100644 index 00000000..3be87055 --- /dev/null +++ b/test/exitrep.asm @@ -0,0 +1,16 @@ +%macro testrep 0.nolist + %assign i 1 + %rep 4 + mov eax,i + %if i==3 + %exitrep + %endif + mov ebx,i + %ifn i < 3 + %error iteration i should not be seen + %endif + %assign i i+1 + %endrep +%endmacro + +testrep