| 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 {
|
|
|