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

Unified Diff: runtime/vm/parser.cc

Issue 148263007: VM: Fix crash when a type error is encountered while evaluating metadata in checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 | tests/lib/lib.status » ('j') | tests/lib/mirrors/regress_16321_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 2e4ecaa55f17e714509c5549154c6f65cd01db71..dc0ac917aefcdb8c3b41b941079112e2990d8483 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -8945,8 +8945,11 @@ RawObject* Parser::EvaluateConstConstructorCall(
if (result.IsError()) {
// An exception may not occur in every parse attempt, i.e., the
// generated AST is not deterministic. Therefore mark the function as
- // not optimizable.
- current_function().SetIsOptimizable(false);
+ // not optimizable. Unless we are evaluating metadata, in which case there
+ // is no current function.
+ if (!parsing_metadata_) {
+ current_function().SetIsOptimizable(false);
+ }
if (result.IsUnhandledException()) {
return result.raw();
} else {
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | tests/lib/mirrors/regress_16321_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698