1
Fork 0

Check vtable projections for validity in miri

This commit is contained in:
Michael Goulet 2024-09-22 20:00:01 -04:00
parent 648d024a78
commit 702a644b74
22 changed files with 143 additions and 87 deletions

View file

@ -712,8 +712,9 @@ impl<'tcx> Stable<'tcx> for mir::interpret::GlobalAlloc<'tcx> {
mir::interpret::GlobalAlloc::Function { instance, .. } => {
GlobalAlloc::Function(instance.stable(tables))
}
mir::interpret::GlobalAlloc::VTable(ty, trait_ref) => {
GlobalAlloc::VTable(ty.stable(tables), trait_ref.stable(tables))
mir::interpret::GlobalAlloc::VTable(ty, dyn_ty) => {
// FIXME: Should we record the whole vtable?
GlobalAlloc::VTable(ty.stable(tables), dyn_ty.principal().stable(tables))
}
mir::interpret::GlobalAlloc::Static(def) => {
GlobalAlloc::Static(tables.static_def(*def))