2010-11-16 Peter Varga <pvarga@inf.u-szeged.hu>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Nov 2010 23:27:13 +0000 (23:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Nov 2010 23:27:13 +0000 (23:27 +0000)
commita5aa7fac59f20ce618857fcc1a4b71a6e7c6962e
tree7698d091bfd4a3da682f63a06d4124d0f5e997a2
parentdcc1e811cc45bfed843f836a34e43b6097068d37
2010-11-16  Peter Varga  <pvarga@inf.u-szeged.hu>

        Reviewed by Gavin Barraclough.

        The number of recursive match calls isn't limited in YARR Interpreter
        https://bugs.webkit.org/show_bug.cgi?id=47906

        Check the number of the matchDisjunction recursive calls to avoid unbounded
        recursion.
        Now the matchDisjunction function returns JSRegExpResult instead of bool.
        The JSRegExpResult enum contains the result of matching or the error code
        of the failure (like HitLimit) which terminates the matching.
        The error codes are based on pcre's jsRegExpExecute error codes.

        * yarr/RegexInterpreter.cpp:
        (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
        (JSC::Yarr::Interpreter::matchParentheses):
        (JSC::Yarr::Interpreter::backtrackParentheses):
        (JSC::Yarr::Interpreter::matchDisjunction):
        (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
        (JSC::Yarr::Interpreter::interpret):
        (JSC::Yarr::Interpreter::Interpreter):
        * yarr/RegexInterpreter.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@72140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/yarr/RegexInterpreter.cpp
JavaScriptCore/yarr/RegexInterpreter.h