Skip to content

Commit

Permalink
Directly check provenance from the AllocId.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Oct 25, 2023
1 parent 72f0e0e commit 8561618
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/gvn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ fn op_to_prop_const<'tcx>(
// Check that we do not leak a pointer.
// Those pointers may lose part of their identity in codegen.
// See https://github.com/rust-lang/rust/issues/79738.
if !value.may_have_provenance(*ecx.tcx, op.layout.size) {
if ecx.tcx.global_alloc(alloc_id).unwrap_memory().inner().provenance().ptrs().is_empty() {
return Some(value);
}

Expand Down

0 comments on commit 8561618

Please sign in to comment.