summaryrefslogtreecommitdiff
path: root/deps/v8/src/regexp/regexp-ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/regexp/regexp-ast.h')
-rw-r--r--deps/v8/src/regexp/regexp-ast.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/deps/v8/src/regexp/regexp-ast.h b/deps/v8/src/regexp/regexp-ast.h
index 9c39dda64e..22c0ee199a 100644
--- a/deps/v8/src/regexp/regexp-ast.h
+++ b/deps/v8/src/regexp/regexp-ast.h
@@ -412,8 +412,12 @@ class RegExpQuantifier final : public RegExpTree {
: body_(body),
min_(min),
max_(max),
- min_match_(min * body->min_match()),
quantifier_type_(type) {
+ if (min > 0 && body->min_match() > kInfinity / min) {
+ min_match_ = kInfinity;
+ } else {
+ min_match_ = min * body->min_match();
+ }
if (max > 0 && body->max_match() > kInfinity / max) {
max_match_ = kInfinity;
} else {