mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 411285 - "js_BoyerMooreHorspool is sometimes called for very short texts" [p=Seno.Aiko@gmail.com r=crowder a1.9=schrep]
This commit is contained in:
parent
c6629bec99
commit
dbfc68a956
@ -1015,7 +1015,7 @@ str_indexOf(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
/* XXX tune the BMH threshold (512) */
|
||||
if ((jsuint)(patlen - 2) <= BMH_PATLEN_MAX - 2 && textlen >= 512) {
|
||||
if (textlen - i >= 512 && (jsuint)(patlen - 2) <= BMH_PATLEN_MAX - 2) {
|
||||
index = js_BoyerMooreHorspool(text, textlen, pat, patlen, i);
|
||||
if (index != BMH_BAD_PATTERN)
|
||||
goto out;
|
||||
|
Loading…
Reference in New Issue
Block a user