Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: src/objects.cc

Issue 2841633004: [regexp] Fix passing all flags to RegExp construction (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/harmony/regexp-dotall.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 5636d826064c44024bbdef0bc7eaeb81177c6457..542ec28bb695a209682437b4764101d3b898cf7e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -16225,7 +16225,7 @@ JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags, bool* success) {
JSRegExp::Flags value = JSRegExp::kNone;
int length = flags->length();
// A longer flags string cannot be valid.
- if (length > 5) return JSRegExp::Flags(0);
+ if (length > JSRegExp::FlagCount()) return JSRegExp::Flags(0);
for (int i = 0; i < length; i++) {
JSRegExp::Flag flag = JSRegExp::kNone;
switch (flags->Get(i)) {
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/harmony/regexp-dotall.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698