]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #107524 - cjgillot:both-storage, r=RalfJung
authorMatthias Krüger <matthias.krueger@famsik.de>
Thu, 2 Feb 2023 16:14:06 +0000 (17:14 +0100)
committerGitHub <noreply@github.com>
Thu, 2 Feb 2023 16:14:06 +0000 (17:14 +0100)
commit6917040cf095f6d116b82184aa005f3eb02c482c
tree56513ade37fe73c98d3d4e4e32c2d968780551dc
parent230c9e91fdeffa7acee1bca0f30a4855835a86e2
parente8ac0404bdff209b9c542e772bf391800924ebf8
Rollup merge of #107524 - cjgillot:both-storage, r=RalfJung

Remove both StorageLive and StorageDead in CopyProp.

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

https://github.com/rust-lang/rust/pull/106908 removed StorageDead without the accompanying StorageLive. In loops, execution would see repeated StorageLive, without any StorageDead, which is UB.

So when removing storage statements, we have to remove both StorageLive and StorageDead.

~I also added a MIR validation pass for StorageLive. It may be a bit overzealous.~