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

Unified Diff: runtime/vm/compiler.cc

Issue 1666323002: Don't allow oob message interrupts while executing constant expressions in the parser. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698