YARR doesn't check for invalid flags for literal regular expressions
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Sep 2016 23:17:59 +0000 (23:17 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Sep 2016 23:17:59 +0000 (23:17 +0000)
commite7beaa4416d021196bf69c0eae502bffe7210811
tree836f13606d7a3c8d75f81a7511cad925e118003d
parent5af341cf4cf75c08abea6050bdf15d4379c85160
YARR doesn't check for invalid flags for literal regular expressions
https://bugs.webkit.org/show_bug.cgi?id=161995

Reviewed by Mark Lam.

JSTests:

New test.

* stress/regress-161995.js: Added.
(testStatic):
(catch):

Source/JavaScriptCore:

Added a new error and a check that the flags are valid when we create a
literal regular expression.

* runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPattern::errorMessage):
(JSC::Yarr::YarrPattern::compile):
* yarr/YarrPattern.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/regress-161995.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/RegExp.cpp
Source/JavaScriptCore/yarr/YarrPattern.cpp
Source/JavaScriptCore/yarr/YarrPattern.h