rust/compiler/rustc_const_eval/src
Trevor Gross 427019e37f
Rollup merge of #128942 - RalfJung:interpret-weak-memory, r=saethlin
miri weak memory emulation: put previous value into initial store buffer

Fixes https://github.com/rust-lang/miri/issues/2164 by doing a read before each atomic write so that we can initialize the store buffer. The read suppresses memory access hooks and UB exceptions, to avoid otherwise influencing the program behavior. If the read fails, we store that as `None` in the store buffer, so that when an atomic read races with the first atomic write to some memory and previously the memory was uninitialized, we can report UB due to reading uninit memory.

``@cbeuw`` this changes a bit the way we initialize the store buffers. Not sure if you still remember all this code, but if you could have a look to make sure this still makes sense, that would be great. :)

r? ``@saethlin``
2024-08-27 01:46:51 -05:00
..
check_consts Auto merge of #129508 - RalfJung:transient-locals, r=cjgillot 2024-08-26 08:44:10 +00:00
const_eval Rollup merge of #129199 - RalfJung:writes_through_immutable_pointer, r=compiler-errors 2024-08-24 22:14:12 +02:00
interpret Rollup merge of #128942 - RalfJung:interpret-weak-memory, r=saethlin 2024-08-27 01:46:51 -05:00
util Auto merge of #128812 - nnethercote:shrink-TyKind-FnPtr, r=compiler-errors 2024-08-14 00:56:53 +00:00
errors.rs Rollup merge of #129199 - RalfJung:writes_through_immutable_pointer, r=compiler-errors 2024-08-24 22:14:12 +02:00
lib.rs stabilize is_none_or 2024-08-14 18:28:40 +08:00