Page 1 of 1

ARexx undefined behavior

Posted: Tue Sep 08, 2020 6:32 pm
by polluks
Please explain the output of this script

Code: Select all

/* Gerard Schildberger's badboy */
do i=0 to 7
$= ''
         do j=0 to i
         $= $ fff(j)
         end
say $
end
exit

/* This is not a procedure, $ is still global */
fff:  $= 12
      return $

Re: ARexx undefined behavior

Posted: Sun Oct 11, 2020 3:32 am
by Spektro
To me it looks like an ARexx bug where $ variable gets a value of some memory address instead of 12, when $ is set in the fff function. The bug seems to emerge not before the fff has been called at least ten times.