Skip to content

Commit 59f290e

Browse files
aamCommit Queue
authored andcommitted
[vm] Clone forwarder function object with relaxed atomics.
TEST=ci BUG=dartbug.com/59594 Change-Id: I8f6b7ee0bb477d1f05cc8baed2b03650888fba5b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396569 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent ed520f5 commit 59f290e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runtime/vm/object.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4346,7 +4346,10 @@ FunctionPtr Function::CreateDynamicInvocationForwarder(
43464346
Zone* zone = thread->zone();
43474347

43484348
Function& forwarder = Function::Handle(zone);
4349-
forwarder ^= Object::Clone(*this, Heap::kOld);
4349+
// Load with relaxed atomics to prevent data race with updating original's
4350+
// properties that are overridden below for the copy anyway.
4351+
forwarder ^= Object::Clone(*this, Heap::kOld,
4352+
/*load_with_relaxed_atomics=*/true);
43504353

43514354
forwarder.reset_unboxed_parameters_and_return();
43524355

0 commit comments

Comments
 (0)