Skip to content

Commit 9f9c311

Browse files
committed
Validate all fields of box instead of validating allocator specifically
1 parent d317988 commit 9f9c311

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_const_eval/src/interpret/validity.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
599599
let ptr = self.ecx.operand_field(&nonnull, 0)?;
600600
self.check_safe_pointer(&ptr, "box")?;
601601

602-
let allocator = self.ecx.operand_field(value, 1)?;
603-
self.visit_field(value, 1, &allocator)?;
602+
// Check other fields of Box
603+
self.walk_value(op)?;
604604
Ok(true)
605605
}
606606
ty::FnPtr(_sig) => {

0 commit comments

Comments
 (0)