ARexx undefined behavior

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
polluks
Posts: 28
Joined: Tue May 19, 2015 6:30 pm
Location: Germany
Contact:

ARexx undefined behavior

Post 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 $
User avatar
Spektro
Beta Tester
Beta Tester
Posts: 117
Joined: Sat Jun 18, 2011 6:55 am
Location: Finland
Contact:

Re: ARexx undefined behavior

Post 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.
- Janne Peräaho
Post Reply