FAQ  •  Register  •  Login

Optimizer bug (*solved*)

<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Fri Oct 17, 2014 7:50 pm

Optimizer bug (*solved*)

I found an error in ZX BASIC optimizer. Take a look at this test program:

  Code:
GO TO 10

sub FASTCALL test(flag AS UBYTE)
    asm
        cp 1
        jp m,45000
        jp 50000
    end asm
end sub

10 POKE 50000,201: POKE 45000,201
   test(1)


This program produces the expected result if you compile it as follows:

  Code:
zxb.exe -t -O2 prog.bas


However it will refuse to compile if you use this instead:

  Code:
zxb.exe -t -O3 prog.bas


In this latter case it will produce this error message:

  Code:
C:>zxb.exe -t -O3 prog.bas
Traceback (most recent call last):
  File "zxb.py", line 348, in <module>
  File "zxb.py", line 301, in main
  File "optimizer.pyc", line 2287, in optimize
  File "optimizer.pyc", line 1493, in update_goes_and_comes
KeyError: '45000'


EDIT: Tested using latest ZX BASIC version 1.4.0s1898.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sat Dec 27, 2014 2:18 pm

Re: Optimizer bug

I think I've fixed it in the Lastest version, 1.4.0s1902. Can you download and check it, please?
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat Dec 27, 2014 4:41 pm

Re: Optimizer bug

It works now, thanks!!!

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 3 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO