@@ -135,20 +135,22 @@ impl StoreBufferAlloc {
135
135
136
136
/// When a non-atomic access happens on a location that has been atomically accessed
137
137
/// before without data race, we can determine that the non-atomic access fully happens
138
- /// before all the prior atomic accesses so the location no longer needs to exhibit
138
+ /// after all the prior atomic accesses so the location no longer needs to exhibit
139
139
/// any weak memory behaviours until further atomic accesses.
140
- pub fn destroy_atomicity < ' tcx > ( & self , range : AllocRange ) {
141
- let mut buffers = self . store_buffers . borrow_mut ( ) ;
142
- let access_type = buffers. access_type ( range) ;
143
- match access_type {
144
- AccessType :: PerfectlyOverlapping ( pos) => {
145
- buffers. remove_from_pos ( pos) ;
146
- }
147
- AccessType :: ImperfectlyOverlapping ( pos_range) => {
148
- buffers. remove_pos_range ( pos_range) ;
149
- }
150
- AccessType :: Empty ( _) => {
151
- // Do nothing
140
+ pub fn memory_accessed < ' tcx > ( & self , range : AllocRange , global : & GlobalState ) {
141
+ if !global. ongoing_atomic_access ( ) {
142
+ let mut buffers = self . store_buffers . borrow_mut ( ) ;
143
+ let access_type = buffers. access_type ( range) ;
144
+ match access_type {
145
+ AccessType :: PerfectlyOverlapping ( pos) => {
146
+ buffers. remove_from_pos ( pos) ;
147
+ }
148
+ AccessType :: ImperfectlyOverlapping ( pos_range) => {
149
+ buffers. remove_pos_range ( pos_range) ;
150
+ }
151
+ AccessType :: Empty ( _) => {
152
+ // The range had no weak behaivours attached, do nothing
153
+ }
152
154
}
153
155
}
154
156
}
0 commit comments