interpret: reset padding during validation
This commit is contained in:
@@ -10,6 +10,7 @@ use rustc_apfloat::{Float, FloatConvert};
|
||||
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
|
||||
use rustc_middle::query::TyCtxtAt;
|
||||
use rustc_middle::ty::layout::TyAndLayout;
|
||||
use rustc_middle::ty::Ty;
|
||||
use rustc_middle::{mir, ty};
|
||||
use rustc_span::def_id::DefId;
|
||||
use rustc_span::Span;
|
||||
@@ -19,7 +20,7 @@ use rustc_target::spec::abi::Abi as CallAbi;
|
||||
use super::{
|
||||
throw_unsup, throw_unsup_format, AllocBytes, AllocId, AllocKind, AllocRange, Allocation,
|
||||
ConstAllocation, CtfeProvenance, FnArg, Frame, ImmTy, InterpCx, InterpResult, MPlaceTy,
|
||||
MemoryKind, Misalignment, OpTy, PlaceTy, Pointer, Provenance, CTFE_ALLOC_SALT,
|
||||
MemoryKind, Misalignment, OpTy, PlaceTy, Pointer, Provenance, RangeSet, CTFE_ALLOC_SALT,
|
||||
};
|
||||
|
||||
/// Data returned by [`Machine::after_stack_pop`], and consumed by
|
||||
@@ -578,6 +579,15 @@ pub trait Machine<'tcx>: Sized {
|
||||
ecx: &InterpCx<'tcx, Self>,
|
||||
instance: Option<ty::Instance<'tcx>>,
|
||||
) -> usize;
|
||||
|
||||
fn cached_union_data_range<'e>(
|
||||
_ecx: &'e mut InterpCx<'tcx, Self>,
|
||||
_ty: Ty<'tcx>,
|
||||
compute_range: impl FnOnce() -> RangeSet,
|
||||
) -> Cow<'e, RangeSet> {
|
||||
// Default to no caching.
|
||||
Cow::Owned(compute_range())
|
||||
}
|
||||
}
|
||||
|
||||
/// A lot of the flexibility above is just needed for `Miri`, but all "compile-time" machines
|
||||
|
||||
Reference in New Issue
Block a user