Skip to content

Commit

Permalink
validate box's allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
beepster4096 committed Jun 27, 2022
1 parent 6e32a16 commit d317988
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_const_eval/src/interpret/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
let nonnull = self.ecx.operand_field(&unique, 0)?;
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)?;
Ok(true)
}
ty::FnPtr(_sig) => {
Expand Down

0 comments on commit d317988

Please sign in to comment.