From 2532cf395a73a4a6fd080bb22d2bedb626ef426c Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 27 Oct 2025 09:57:36 -0700 Subject: [PATCH] [vm] Grab read program lock when querying Class functions. Fixes https://github.com/dart-lang/sdk/issues/61734 TEST=tsan ci Change-Id: Id0c905109ad88f9a0e4abc302b7ad90b8239a86a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457140 Commit-Queue: Alexander Aprelev Reviewed-by: Ryan Macnak --- runtime/vm/compiler/backend/flow_graph_compiler.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc index 6f12fdded8d..658ac828232 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc @@ -2013,6 +2013,7 @@ bool FlowGraphCompiler::LookupMethodFor(int class_id, Class& cls = Class::Handle(zone, raw_class); if (cls.IsNull()) return false; if (!cls.is_finalized()) return false; + SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock()); if (Array::Handle(cls.current_functions()).IsNull()) return false; if (class_is_abstract_return != nullptr) {