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
#2
I've been rather busy. :oops: Sorry.
I've fixed that bug in the latest version 1.3.0 s947, but now other code is suboptimal. :x So still needs some work, I guess.
Reply
#3
boriel Wrote:I've been rather busy. :oops: Sorry.
I've fixed that bug in the latest version 1.3.0 s947, but now other code is suboptimal. :x So still needs some work, I guess.
Thanks! Don't worry, I reduced my retro activity after my father died. Hope to get up soon. Will check the new version tomorrow.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#4
Oh, I'm very sorry to hear that :!: Sad
My condolences in these sad moments.

Hope you get up and back here soon.
Reply
#5
boriel Wrote:Oh, I'm very sorry to hear that :!: Sad
My condolences in these sad moments.

Hope you get up and back here soon.
Thanks. I hope this too...
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#6
I had not seen these posts, I'm sorry to read this .

My condolences LCD.
Reply
#7
JBGV Wrote:I had not seen these posts, I'm sorry to read this .

My condolences LCD.
Thank you.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#8
BTW, is this bug fixed?
Reply
#9
boriel Wrote:BTW, is this bug fixed?
Oops, I forgot to answer: yes, thamks, it was fixed.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)