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

Unified Diff: src/jsregexp.cc

Issue 8387027: Make the irregexp interpreter throw on stack overflow. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/interpreter-irregexp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index c1a9e067c9374163d5fe54ed46081fac781df963..18ff2570e6ef3124f6e4ee07856872c5e431b53c 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -509,14 +509,16 @@ RegExpImpl::IrregexpResult RegExpImpl::IrregexpExecOnce(
}
Handle<ByteArray> byte_codes(IrregexpByteCode(*irregexp, is_ascii), isolate);
- if (IrregexpInterpreter::Match(isolate,
- byte_codes,
- subject,
- register_vector,
- index)) {
- return RE_SUCCESS;
- }
- return RE_FAILURE;
+ IrregexpResult result = IrregexpInterpreter::Match(isolate,
+ byte_codes,
+ subject,
+ register_vector,
+ index);
+ if (result == RE_EXCEPTION) {
+ ASSERT(!isolate->has_pending_exception());
+ isolate->StackOverflow();
Erik Corry 2011/10/25 12:58:41 Do we do this for compiled regexps?
Lasse Reichstein 2011/10/25 13:27:10 Yes. It's handled a little further up the call-cha
+ }
+ return result;
#endif // V8_INTERPRETED_REGEXP
}
« no previous file with comments | « src/interpreter-irregexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698