Skip to content

Commit d317988

Browse files
committed
validate box's allocator
1 parent 6e32a16 commit d317988

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_const_eval/src/interpret/validity.rs

+3
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
598598
let nonnull = self.ecx.operand_field(&unique, 0)?;
599599
let ptr = self.ecx.operand_field(&nonnull, 0)?;
600600
self.check_safe_pointer(&ptr, "box")?;
601+
602+
let allocator = self.ecx.operand_field(value, 1)?;
603+
self.visit_field(value, 1, &allocator)?;
601604
Ok(true)
602605
}
603606
ty::FnPtr(_sig) => {

0 commit comments

Comments
 (0)