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

Unified Diff: runtime/vm/parser.cc

Issue 15904010: Fix issue 3874: non-deterministic AST generation caused by exceptions being thrown during parsing (… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « runtime/vm/flow_graph_inliner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 23328)
+++ runtime/vm/parser.cc (working copy)
@@ -8118,6 +8118,10 @@
if (const_value.IsError()) {
const Error& error = Error::Cast(const_value);
if (error.IsUnhandledException()) {
+ // An exception may not occur in every parse attemp, i.e., the
Florian Schneider 2013/05/29 12:58:45 s/attemp/attempt/
srdjan 2013/05/29 13:01:29 Done.
+ // generated AST is not deterministic. Therefore mark the function as
+ // not optimizable.
+ current_function().set_is_optimizable(false);
field.set_value(Instance::Handle());
// It is a compile-time error if evaluation of a compile-time constant
// would raise an exception.
@@ -8181,6 +8185,10 @@
arg_values,
arg_descriptor));
if (result.IsError()) {
+ // An exception may not occur in every parse attemp, i.e., the
Florian Schneider 2013/05/29 12:58:45 s/attemp/attempt/
srdjan 2013/05/29 13:01:29 Done.
+ // generated AST is not deterministic. Therefore mark the function as
+ // not optimizable.
+ current_function().set_is_optimizable(false);
if (result.IsUnhandledException()) {
return result.raw();
} else {
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698