flat assembler
Message board for the users of flat assembler.

Index > IDE Development > Replace bug?

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 08 Feb 2012, 17:11
given this code
Code:
        dd minicube,300,3200,400
        dd minicube,300,3200,400
        dd minicube,300,3200,400
    


when i try to replace 0,400 by 0,400,Blue

only the first line will be replaced. if the first line don't end with 0,400 it will replace nothing at all...
here the gif of the problem: http://fool.codercat.org/fasmreplacebug.gif
tested with the very last version of fasm

it happens with the file uploaded, never saw this bug before.

thanks.


Description: i try to replace 0,400 by 0,400,BLue
Download
Filename: about.inc
Filesize: 2.22 KB
Downloaded: 612 Time(s)

Post 08 Feb 2012, 17:11
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 08 Feb 2012, 19:02
The problem can be more easily seen by just trying to find the following string patterns:
(always without qoutes)
"400" : no problems
",400" : finds the occurrences, but if you open the search dialog again it shows "400" (i.e. it removes the comma)
"0,400" : finds nothing.

By some quick testing, it seems that searches like x,y are converted into y the next time you open the search dialog. The "0,400" and "0,Blu" patterns fail, but "0,4", "0,40", "0,B", "0,Bl" and "0,Blue" all work.
Post 08 Feb 2012, 19:02
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 08 Feb 2012, 20:50
tested with:
Code:
0,000
0,000
0,000
    

replace 0,000 by 0,00 OK
Code:
0,000,123
0,000,123
    

replace 0,123 by 0,00 OK
Code:
0,00,400
0,00,400
    

replace 0,400 by 0,00 OK
Code:
0,222,400
0,222,400
    

replace 2,400 by 0,00 OK
Code:
0,000,400
0,000,400
    

replace 0,400 by 0,00 notfound
Code:
0,000,100
0,000,100
    

replace 0,100 by 0,00 notfound
Code:
0,222,122
0,222,122
    

replace 2,122 by 0,00 not found

Code:
0,222,122
0,222,122
22*2,122   
    

replace 2.122 by 0,00 Ok, one replace here->*
Code:
;CURSOR position->*
0,22*2,122
0,222,122
    

replace 2,122 by 0,00 replace ok, 1 replace

but what is the limit?
Post 08 Feb 2012, 20:50
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 09 Feb 2012, 15:45
Quick fix: in SEARCH.INC find this section
Code:
    match_part_of_suffix:
        mov     eax,[esp]
        push    ecx esi edi
        xchg    eax,esi
        sub     eax,esi
        sub     ecx,eax
        repe    cmpsb
        pop     edi esi ecx
        jne     suffix_match_shifts_table_done
    store_suffix_match_shift:    
and replace "sub ecx,eax" with "add ecx,eax".

I will upload the corrected package later.
Post 09 Feb 2012, 15:45
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 09 Feb 2012, 22:40
thank you so much Smile
Post 09 Feb 2012, 22:40
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.