cleanup op_to_const a bit; rename ConstValue::ByRef → Indirect

This commit is contained in:
Ralf Jung 2023-09-12 07:49:25 +02:00
parent 551f481ffb
commit 0f8908da27
14 changed files with 40 additions and 47 deletions

View file

@ -756,7 +756,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
};
let layout = from_known_layout(self.tcx, self.param_env, layout, || self.layout_of(ty))?;
let op = match val_val {
ConstValue::ByRef { alloc_id, offset } => {
ConstValue::Indirect { alloc_id, offset } => {
// We rely on mutability being set correctly in that allocation to prevent writes
// where none should happen.
let ptr = self.global_base_pointer(Pointer::new(alloc_id, offset))?;