mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
6ac598a472
miri: treat non-memory local variables properly for data race detection Fixes https://github.com/rust-lang/miri/issues/3242 Miri has an optimization where some local variables are not represented in memory until something forces them to be stored in memory (most notably, creating a pointer/reference to the local will do that). However, for a subsystem triggering on memory accesses -- such as the data race detector -- this means that the memory access seems to happen only when the local is moved to memory, instead of at the time that it actually happens. This can lead to UB reports in programs that do not actually have UB. This PR fixes that by adding machine hooks for reads and writes to such efficiently represented local variables. The data race system tracks those very similar to how it would track reads and writes to addressable memory, and when a local is moved to memory, the clocks get overwritten with the information stored for the local. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |