From 4c9b7d253a487a8112b2867916fa60efa46af94a Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Fri, 24 Feb 2023 19:37:02 -0800 Subject: [PATCH] move fence to the right place --- src/coreclr/gc/gc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index c4b719d2bdaddd..1ddb6bd55b5000 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -16826,7 +16826,8 @@ BOOL gc_heap::a_fit_segment_end_p (int gen_number, // (see also: object.cpp/Object::ValidateInner) // Make sure it will see cleaned up state to prevent triggering occasional verification failures. // And make sure the write happens before updating "allocated" - VolatileStore(((void**)allocated - 1), (void*)0); //clear the sync block + ((void**)allocated)[-1] = 0; // clear the sync block + VOLATILE_MEMORY_BARRIER(); #endif //VERIFY_HEAP && _DEBUG uint8_t* old_alloc;