1
Fork 0

Validate all fields of box instead of validating allocator specifically

This commit is contained in:
DrMeepster 2022-06-28 02:19:52 -07:00
parent d317988505
commit 9f9c311718

View file

@ -599,8 +599,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
let ptr = self.ecx.operand_field(&nonnull, 0)?; let ptr = self.ecx.operand_field(&nonnull, 0)?;
self.check_safe_pointer(&ptr, "box")?; self.check_safe_pointer(&ptr, "box")?;
let allocator = self.ecx.operand_field(value, 1)?; // Check other fields of Box
self.visit_field(value, 1, &allocator)?; self.walk_value(op)?;
Ok(true) Ok(true)
} }
ty::FnPtr(_sig) => { ty::FnPtr(_sig) => {