Skip to content

Commit

Permalink
Validate all fields of box instead of validating allocator specifically
Browse files Browse the repository at this point in the history
  • Loading branch information
beepster4096 committed Jun 28, 2022
1 parent d317988 commit 9f9c311
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/interpret/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
let ptr = self.ecx.operand_field(&nonnull, 0)?;
self.check_safe_pointer(&ptr, "box")?;

let allocator = self.ecx.operand_field(value, 1)?;
self.visit_field(value, 1, &allocator)?;
// Check other fields of Box
self.walk_value(op)?;
Ok(true)
}
ty::FnPtr(_sig) => {
Expand Down

0 comments on commit 9f9c311

Please sign in to comment.