use AllocId instead of Allocation in ConstValue::ByRef

This commit is contained in:
Ralf Jung
2023-09-11 20:01:48 +02:00
parent c728bf3963
commit 551f481ffb
15 changed files with 80 additions and 63 deletions

View File

@@ -148,10 +148,7 @@ pub(super) fn op_to_const<'tcx>(
let to_const_value = |mplace: &MPlaceTy<'_>| {
debug!("to_const_value(mplace: {:?})", mplace);
match mplace.ptr().into_parts() {
(Some(alloc_id), offset) => {
let alloc = ecx.tcx.global_alloc(alloc_id).unwrap_memory();
ConstValue::ByRef { alloc, offset }
}
(Some(alloc_id), offset) => ConstValue::ByRef { alloc_id, offset },
(None, offset) => {
assert!(mplace.layout.is_zst());
assert_eq!(