Chromium Code Reviews| Index: runtime/vm/compiler.cc |
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc |
| index 7c88444c94d75e6546c1e3abc203d1b617e42e50..1b597c24eabe7a8b987709aa569006c2a3d52961 100644 |
| --- a/runtime/vm/compiler.cc |
| +++ b/runtime/vm/compiler.cc |
| @@ -1636,6 +1636,11 @@ RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { |
| LongJumpScope jump; |
| if (setjmp(*jump.Set()) == 0) { |
| Thread* const thread = Thread::Current(); |
| + Isolate* const isolate = thread->isolate(); |
| + |
| + // Don't allow message interrupts while executing constant |
| + // expressions. They can cause bogus recursive compilation. |
| + isolate->DeferMessageInterrupts(); |
|
Cutch
2016/02/09 17:05:51
DBC: Consider adding a scope object helper class.
|
| if (FLAG_trace_compiler) { |
| THR_Print("compiling expression: "); |
| AstPrinter::PrintNode(fragment); |
| @@ -1682,6 +1687,7 @@ RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { |
| const Object& result = PassiveObject::Handle( |
| DartEntry::InvokeFunction(func, Object::empty_array())); |
| + isolate->RestoreMessageInterrupts(); |
| return result.raw(); |
| } else { |
| Thread* const thread = Thread::Current(); |
| @@ -1689,6 +1695,7 @@ RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { |
| const Object& result = |
| PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| isolate->object_store()->clear_sticky_error(); |
| + isolate->RestoreMessageInterrupts(); |
| return result.raw(); |
| } |
| UNREACHABLE(); |