fix box with custom allocator in miri

This commit is contained in:
DrMeepster 2022-06-26 13:58:37 -07:00
parent 8aab472d52
commit 6e32a16520
2 changed files with 4 additions and 17 deletions

View file

@ -594,7 +594,10 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
Ok(true)
}
ty::Adt(def, ..) if def.is_box() => {
self.check_safe_pointer(value, "box")?;
let unique = self.ecx.operand_field(value, 0)?;
let nonnull = self.ecx.operand_field(&unique, 0)?;
let ptr = self.ecx.operand_field(&nonnull, 0)?;
self.check_safe_pointer(&ptr, "box")?;
Ok(true)
}
ty::FnPtr(_sig) => {