bobbimanners / EightBall

The Eight Bit Algorithmic Language for Apple II, Commodore 64 and VIC20
GNU General Public License v3.0
19 stars 3 forks source link

Compiler bug #28

Closed bobbimanners closed 6 years ago

bobbimanners commented 6 years ago

Suppose we have a subroutine like this:

sub foo()
 word i=0
 for i=0:10
  if i%3
   return 1
  endif
 endfor
endsub

It works fine interpreted and compiled the first few times, but when compiled it leaks the eval stack each time we do the return 1. The reason for this is the for pushes some stuff to the eval stack which the endfor usually handles, but here we are jumping out. Need to re-work this code. Think it only applies to this specific case with for loops.

bobbimanners commented 6 years ago

Reworked the code and resolved this issue. Will be fixed in v0.68.