Skip to content

Commit dbde843

Browse files
committed
Only ignore SC stores when the load is SC
1 parent 45089bc commit dbde843

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/weak_memory.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,15 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
182182
true
183183
})
184184
.filter(|&store_elem| {
185-
// Skip over all but the last SC store
186-
let include = !(store_elem.is_seqcst && found_sc);
187-
found_sc |= store_elem.is_seqcst;
188-
include
185+
if is_seqcst {
186+
// An SC load needs to ignore all but last store maked SC (stores not marked SC are not
187+
// affected)
188+
let include = !(store_elem.is_seqcst && found_sc);
189+
found_sc |= store_elem.is_seqcst;
190+
include
191+
} else {
192+
true
193+
}
189194
});
190195

191196
candidates.choose(rng)

0 commit comments

Comments
 (0)