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

Unified Diff: src/runtime/runtime-regexp.cc

Issue 2778953004: [regexp] Properly handle failed RegExp compilations (Closed)
Patch Set: --stack-size Created 3 years, 9 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 | « no previous file | test/mjsunit/regress/regress-705934.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-705934.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698