| Index: src/runtime/runtime-regexp.cc
|
| diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc
|
| index e5d6e4c71ed8cfac85fc4d823d1cb45c89bf1a80..e1a2da3a9c08537cb8863a06191d6ddf42d30f84 100644
|
| --- a/src/runtime/runtime-regexp.cc
|
| +++ b/src/runtime/runtime-regexp.cc
|
| @@ -606,7 +606,10 @@ MUST_USE_RESULT static Object* StringReplaceGlobalRegExpWithString(
|
| JSRegExp::Type typeTag = regexp->TypeTag();
|
| if (typeTag == JSRegExp::IRREGEXP) {
|
| // Ensure the RegExp is compiled so we can access the capture-name map.
|
| - RegExpImpl::IrregexpPrepare(regexp, subject);
|
| + if (RegExpImpl::IrregexpPrepare(regexp, subject) == -1) {
|
| + DCHECK(isolate->has_pending_exception());
|
| + return isolate->heap()->exception();
|
| + }
|
| }
|
|
|
| // CompiledReplacement uses zone allocation.
|
|
|