Author Topic: %exitrep issue.  (Read 11268 times)

Offline Mathi

  • Jr. Member
  • *
  • Posts: 82
  • Country: in
    • Win32NASM
%exitrep issue.
« on: January 08, 2013, 12:30:57 PM »
Hi All,

Noted one thing.

%exitrep doesn't exit the %rep block immediately. It completes the iteration before exiting.
This issue is there in,
NASM version 2.10.07 compiled on Jan  2 2013

I searched bugzilla and found
Bug 3088881 - %exitrep does not immediately terminate %rep

Probably this bug is persisting due to the revert of preproc rewrite.

Workaround is easy. Still wanted to post this.

Sample code.

Code: [Select]
%assign counter 0
%rep 5
%assign counter counter+1
%if counter > 0
%exitrep ; should have jumped out in the first iteration.
%endif
%rep 2
%warning shouldn't have printed this line.
%endrep
%endrep

when assembling with

nasm -E test.asm 

Control flows through ...  %warning shouldn't have printed this line.

Regards,
Mathi.
« Last Edit: January 08, 2013, 01:48:41 PM by Mathi »