strfind: assure re-check is done on mismatch after initial match + add tests
This commit is contained in:
@@ -192,6 +192,17 @@ strfind:
|
||||
|
||||
.noMatch:
|
||||
; not gonna figure out here if there was an existing match already. just XOR r10b,r10b and load original pointer to what[] to rsi
|
||||
; EDIT: actually yes I am. strfind("gidgiddy", "giddy", 0); [gid]giddy<>[gid]dy is a match but then gid[g]iddy<>gid[d]y is not while it should check gid[g]iddy<>[g]iddy
|
||||
test r10b, r10b
|
||||
jz .continueLoop
|
||||
mov rsi, r11
|
||||
mov r9b, byte [rsi]
|
||||
cmp byte [rdi], r9b
|
||||
jne .itReallyWasNoMatchAfterAll
|
||||
mov r8, rcx
|
||||
inc rsi
|
||||
jmp .continueLoop
|
||||
.itReallyWasNoMatchAfterAll:
|
||||
xor r10b, r10b
|
||||
mov rsi, r11
|
||||
|
||||
|
Reference in New Issue
Block a user