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

@ -318,10 +318,10 @@ impl<'tcx> ReachableContext<'tcx> {
));
self.visit(instance.args);
}
GlobalAlloc::VTable(ty, trait_ref) => {
GlobalAlloc::VTable(ty, dyn_ty) => {
self.visit(ty);
// Manually visit to actually see the trait's `DefId`. Type visitors won't see it
if let Some(trait_ref) = trait_ref {
if let Some(trait_ref) = dyn_ty.principal() {
let ExistentialTraitRef { def_id, args } = trait_ref.skip_binder();
self.visit_def_id(def_id, "", &"");
self.visit(args);