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;