diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-04-30 09:55:24 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-05-09 17:59:35 +0000 |
| commit | 3268f2e61dcf2132570f5e36147a67bc25355a40 (patch) | |
| tree | 30d834f1ca64602df803bac85a2b134fd2acbd9c | |
| parent | 0bd9bd6b8acfcd102bbc31ac407f1883480accbc (diff) | |
| download | rust-3268f2e61dcf2132570f5e36147a67bc25355a40.tar.gz rust-3268f2e61dcf2132570f5e36147a67bc25355a40.zip | |
Only check that StorageLive dominates address-taking.
| -rw-r--r-- | compiler/rustc_mir_transform/src/ssa.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs index d7fc6e2f6c3..fe2e79a4fc1 100644 --- a/compiler/rustc_mir_transform/src/ssa.rs +++ b/compiler/rustc_mir_transform/src/ssa.rs @@ -7,7 +7,7 @@ //! //! We say a local has a stable address if its address has SSA-like properties: //! 1/ It has a single `StorageLive` statement, or none at all (always-live); -//! 2/ All its uses dominate this `StorageLive` statement. +//! 2/ This `StorageLive` statement dominates all statements that take this local's address. //! //! We do not discard borrowed locals from this analysis, as we cannot take their address' address. @@ -247,7 +247,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor { // Only record if SSA-like, to avoid growing the vector needlessly. self.assignment_order.push(local); } - self.dominators.check_dominates(&mut self.storage_live[local], loc); } // Anything can happen with raw pointers, so remove them. // We do not verify that all uses of the borrow dominate the assignment to `local`, @@ -264,7 +263,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor { } PlaceContext::NonMutatingUse(_) => { self.dominators.check_dominates(&mut self.assignments[local], loc); - self.dominators.check_dominates(&mut self.storage_live[local], loc); self.direct_uses[local] += 1; } PlaceContext::NonUse(NonUseContext::StorageLive) => { @@ -283,7 +281,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor { self.visit_projection(place.as_ref(), new_ctxt, loc); self.dominators.check_dominates(&mut self.assignments[place.local], loc); - self.dominators.check_dominates(&mut self.storage_live[place.local], loc); } return; } else { |
