@@ -338,6 +338,10 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
338338 { "invalid drop function pointer in vtable (not pointing to a function)" } ,
339339 err_ub!( InvalidVtableDropFn ( ..) ) =>
340340 { "invalid drop function pointer in vtable (function has incompatible signature)" } ,
341+ // Stacked Borrows errors can happen here, see https://github.com/rust-lang/miri/issues/2123.
342+ // (We assume there are no other MachineStop errors possible here.)
343+ InterpError :: MachineStop ( _) =>
344+ { "vtable pointer does not have permission to read drop function pointer" } ,
341345 ) ;
342346 try_validation ! (
343347 self . ecx. read_size_and_align_from_vtable( vtable) ,
@@ -347,6 +351,10 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
347351 err_ub!( InvalidVtableAlignment ( msg) ) =>
348352 { "invalid vtable: alignment {}" , msg } ,
349353 err_unsup!( ReadPointerAsBytes ) => { "invalid size or align in vtable" } ,
354+ // Stacked Borrows errors can happen here, see https://github.com/rust-lang/miri/issues/2123.
355+ // (We assume there are no other MachineStop errors possible here.)
356+ InterpError :: MachineStop ( _) =>
357+ { "vtable pointer does not have permission to read size and alignment" } ,
350358 ) ;
351359 // FIXME: More checks for the vtable.
352360 }
0 commit comments