about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-10-05 17:27:32 +0530
committerGitHub <noreply@github.com>2022-10-05 17:27:32 +0530
commitab88c19f15fe12625524a6474e0d63ead0333be0 (patch)
treeeb5946f2c631f32f38b3fb2abee05eef4a84d37c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentf8f501997a4b293db86d6358c21a5de5642a5d66 (diff)
parenta0131f0a369dcb44c855d0ce483744e6efaa3df8 (diff)
downloadrust-ab88c19f15fe12625524a6474e0d63ead0333be0.tar.gz
rust-ab88c19f15fe12625524a6474e0d63ead0333be0.zip
Rollup merge of #101061 - RalfJung:panic-on-uninit, r=oli-obk
panic-on-uninit: adjust checks to 0x01-filling

Now that `mem::uninitiailized` actually fills memory with `0x01` (https://github.com/rust-lang/rust/pull/99182), we can make it panic in a few less cases without risking a lot more UB -- which hopefully slightly improves compatibility with some old code, and which might increase the chance that we can check inside arrays in the future.

We detect almost all of these with our lint, so authors of such code should still be warned -- but if this happens deep inside a dependency, the panic can be quite interruptive, so it might be better not to do it when there is no risk of LLVM UB.  Therefore, adjust the `might_permit_raw_init` logic to care primarily about LLVM UB. To my knowledge, it actually covers all cases of LLVM UB now.

Fixes https://github.com/rust-lang/rust/issues/66151

Cc ``@5225225``
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions