about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-09-15 16:01:36 +0200
committerGitHub <noreply@github.com>2024-09-15 16:01:36 +0200
commit6ac598a4724effcbdb7fcc02de6cd1238096a7d5 (patch)
tree5bc03d08606f0d7ebe9a0cffe386bc54c791a4d2 /compiler/rustc_codegen_llvm/src
parentdf3cf91b63a75db9388467b1a182059f8429b158 (diff)
parent339f68bd6c4bdb673cfbd81a26866dc31936f6a7 (diff)
downloadrust-6ac598a4724effcbdb7fcc02de6cd1238096a7d5.tar.gz
rust-6ac598a4724effcbdb7fcc02de6cd1238096a7d5.zip
Rollup merge of #129828 - RalfJung:miri-data-race, r=saethlin
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions