Index: runtime/vm/flow_graph_builder.cc |
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc |
index da2caaadb36901bf66eba322f7d04cc64e55e28e..ec41c27904032a85c88bd396971ba8c0db563ee1 100644 |
--- a/runtime/vm/flow_graph_builder.cc |
+++ b/runtime/vm/flow_graph_builder.cc |
@@ -2530,13 +2530,15 @@ void EffectGraphVisitor::VisitStringInterpolateNode( |
static void CollectClosureFunction(const Function& function) { |
if (function.HasCode()) return; |
- Isolate* isolate = Isolate::Current(); |
+ Thread* thread = Thread::Current(); |
+ Isolate* isolate = thread->isolate(); |
if (isolate->collected_closures() == GrowableObjectArray::null()) { |
isolate->set_collected_closures( |
GrowableObjectArray::Handle(GrowableObjectArray::New())); |
} |
const GrowableObjectArray& functions = |
- GrowableObjectArray::Handle(isolate, isolate->collected_closures()); |
+ GrowableObjectArray::Handle(thread->zone(), |
+ isolate->collected_closures()); |
functions.Add(function); |
} |