@@ -338,6 +338,10 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
338
338
{ "invalid drop function pointer in vtable (not pointing to a function)" } ,
339
339
err_ub!( InvalidVtableDropFn ( ..) ) =>
340
340
{ "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" } ,
341
345
) ;
342
346
try_validation ! (
343
347
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, '
347
351
err_ub!( InvalidVtableAlignment ( msg) ) =>
348
352
{ "invalid vtable: alignment {}" , msg } ,
349
353
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" } ,
350
358
) ;
351
359
// FIXME: More checks for the vtable.
352
360
}
0 commit comments