The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimiser level 3 bug found (*solved*)
#1
Hi Boriel!
I just ran into a bug with this code:
Code:
paper 7:ink 0:border 7:cls Function code2level() as ubyte dim adr as uinteger dim count as ubyte adr=@buffer count=0 do if not (peek(Uinteger,adr)-peek(Uinteger,@inpstring+3)+peek(Uinteger,adr+2)-peek(Uinteger,@inpstring+5)+peek(Uinteger,adr+4)-peek(Uinteger,@inpstring+7)) goto passok Else count=count+1:adr=adr+6 end if loop until count=32 count=255 passok: return count end function print code2level() End inpstring: asm defb 1,1,56 defm "Leveld" end asm buffer: asm defm "Level1" defm "Level2" defm "Level3" defm "Level4" defm "Level5" defm "Level6" defm "Level7" defm "Level8" defm "Level9" defm "Level0" defm "Levela" defm "Levelb" defm "Levelc" defm "Leveld" defm "Levele" defm "Levelf" defm "Levelg" defm "Levelh" defm "Leveli" defm "Levelj" defm "Levelk" defm "Levell" defm "Levelm" defm "Leveln" defm "Levelo" defm "Levelp" defm "Levelq" defm "Levelr" defm "Levels" defm "Levelt" defm "Levelu" defm "Levelv" end asm
Without Optimiser or at level 1 or 2 it displays the correct value (13), but with Optimiser level 3 it runs through all the strings aot finding the correct one, so the output is 255 which here means "code not found".
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)