From dced438e7568efcff48748839b235c499cf7494e Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 30 Apr 2024 17:48:19 +0000 Subject: [PATCH] [vm] Access Function::code_ with acquire-release ordering. TEST=tsan Bug: https://github.com/dart-lang/sdk/issues/55597 Change-Id: I915dfc6e3ec9e547f50e649b9dd430a5c7c52752 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364969 Reviewed-by: Alexander Aprelev Commit-Queue: Ryan Macnak --- runtime/vm/object.cc | 2 +- runtime/vm/object.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index fe44666d097..8b891d05777 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -7976,7 +7976,7 @@ void Function::SetInstructions(const Code& value) const { } void Function::SetInstructionsSafe(const Code& value) const { - untag()->set_code(value.ptr()); + untag()->set_code(value.ptr()); StoreNonPointer(&untag()->entry_point_, value.EntryPoint()); StoreNonPointer(&untag()->unchecked_entry_point_, value.UncheckedEntryPoint()); diff --git a/runtime/vm/object.h b/runtime/vm/object.h index 342d6400306..f9ce4ff435d 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h @@ -3159,7 +3159,7 @@ class Function : public Object { bool SafeToClosurize() const; static CodePtr CurrentCodeOf(const FunctionPtr function) { - return function->untag()->code(); + return function->untag()->code(); } CodePtr unoptimized_code() const {