Skip to content

Commit 6b413d9

Browse files
committed
Throw validation failure for InvalidUndefBytes.
1 parent bc7b714 commit 6b413d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_mir/interpret/validity.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::ops::RangeInclusive;
1111

1212
use rustc_data_structures::fx::FxHashSet;
1313
use rustc_hir as hir;
14+
use rustc_middle::mir::interpret::{InterpError, InterpErrorInfo};
1415
use rustc_middle::ty;
1516
use rustc_middle::ty::layout::TyAndLayout;
1617
use rustc_span::symbol::{sym, Symbol};
@@ -492,7 +493,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
492493
// that lets us re-use `ref_to_mplace`).
493494
let place = try_validation_pat!(
494495
self.ecx.ref_to_mplace(self.ecx.read_immediate(value)?),
495-
_,
496+
InterpErrorInfo { kind: err_ub!(InvalidUndefBytes(..)), ..},
496497
"uninitialized raw pointer",
497498
self.path
498499
);

0 commit comments

Comments
 (0)