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

Unified Diff: src/rewriter.cc

Issue 9429: Handle stack overflow errors correctly when rewriting the AST... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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/rewriter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/rewriter.cc
===================================================================
--- src/rewriter.cc (revision 700)
+++ src/rewriter.cc (working copy)
@@ -761,17 +761,20 @@
}
-void Rewriter::Optimize(FunctionLiteral* function) {
+bool Rewriter::Optimize(FunctionLiteral* function) {
ZoneList<Statement*>* body = function->body();
- if (body->is_empty()) return;
- if (FLAG_optimize_ast) {
+ if (FLAG_optimize_ast && !body->is_empty()) {
Scope* scope = function->scope();
if (!scope->is_global_scope()) {
AstOptimizer optimizer;
optimizer.Optimize(body);
+ if (optimizer.HasStackOverflow()) {
+ return false;
+ }
}
}
+ return true;
}
« no previous file with comments | « src/rewriter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698