зеркало из https://github.com/mozilla/gecko-dev.git
Fixed non-terminating regexp when max quantifier is unspecified as in :
var s = 'zzabc.'; var reg = /[^z]{1,}\./; s.match(reg); - wasn't checking for reaching end of text.
This commit is contained in:
Родитель
b7e419646f
Коммит
2622a174d3
|
@ -2442,7 +2442,7 @@ MatchRegExp(MatchState *state, jsbytecode *pc, const jschar *cp)
|
|||
cp = MatchRegExp(state, pc2, cp);
|
||||
state->pcend = pcend;
|
||||
/* couldn't grab one more, so bail */
|
||||
if (!cp)
|
||||
if (!cp || (cp == cpend))
|
||||
return cp2;
|
||||
num++;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче