From 6b413d95fc3035fff80c0388049d5b7c178a3c59 Mon Sep 17 00:00:00 2001 From: jumbatm Date: Wed, 29 Apr 2020 09:41:01 +1000 Subject: [PATCH] Throw validation failure for InvalidUndefBytes. --- src/librustc_mir/interpret/validity.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs index d6202638fd9..ab440cc5eba 100644 --- a/src/librustc_mir/interpret/validity.rs +++ b/src/librustc_mir/interpret/validity.rs @@ -11,6 +11,7 @@ use std::ops::RangeInclusive; use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; +use rustc_middle::mir::interpret::{InterpError, InterpErrorInfo}; use rustc_middle::ty; use rustc_middle::ty::layout::TyAndLayout; use rustc_span::symbol::{sym, Symbol}; @@ -492,7 +493,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, ' // that lets us re-use `ref_to_mplace`). let place = try_validation_pat!( self.ecx.ref_to_mplace(self.ecx.read_immediate(value)?), - _, + InterpErrorInfo { kind: err_ub!(InvalidUndefBytes(..)), ..}, "uninitialized raw pointer", self.path );