Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#123 loop not completely ended after signal

closed-fixed
None
5
2013-06-28
2003-07-02
No

#!/usr/bin/rexx
x=0
again:
if x=2 then exit
do i=1 to 4
say x i
if i=2 then do
x=x+1
signal again
end
end
say 'ended'

Result:

0 1
0 2
1 3
1 4
ended

Manual (page 46):
When the control of execution is transferred by a
SIGNAL instruction, all active loops at the current
procedural level are terminated, i.e. they can not
continued later, although they can of course be
reentered from the normal start.

Correct result would be:

0 1
0 2
1 1
1 2
ended

Discussion

  • Logged In: YES
    user_id=814107

    Did resolve the problem by adding innerloop = NULL in
    interprt.c

    *** interprt.c.original Wed Apr 2 09:45:47 2003
    --- interprt.c Fri Jul 4 15:18:06 2003
    ***************
    *** 1311,1316 ****
    --- 1311,1319 ----
    }

    stackcleanup(TSD,stktrigger);
    + /* modification start */
    + innerloop = NULL;
    + /* modification end */
    set_sigl( TSD, this->lineno ) ;
    entry = getlabel( TSD, cptr ) ;
    /*

     
  • Mark Hessling
    Mark Hessling
    2003-07-06

    • assigned_to: nobody --> fgc
     
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=262734

    The fix is correct. Thank you very much.
    It will be available in the next official release.