Updates:
Status: Duplicate
Mergedinto: 287
Comment #1 on issue 2001 by [email protected]: Regexp infinite loop
http://code.google.com/p/v8/issues/detail?id=2001
The problem is that the loop isn't infinite. It's just very long-running.
Obviously it's possible to detect a long-running RegExp and terminate it
somehow, but V8 already allows the embedding application, typically the
browser, to interrupt execution. I.e., the functionality is already there,
and is being used to abort any long-running scripts. From the browser's
perspective, a long running RegExp isn't really different
from "while(true);".
Using the existing functionality also has the advantage that we don't have
to introduce a new, arbitrary, limit on RegExp execution, and it avoids the
issue of deciding what to do when you abort execution. Other JS
implementations act as if the RegExp matching failed, even if it would
eventually have succeeded - i.e., they give the wrong answer.
If your code is running in a context where it's not interrupted if runs too
long, you might want to petition the embedded for a way to stop runaway
scripts.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev