]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/interpret/memory.rs
Sanity-check all constants
[rust.git] / src / librustc_mir / interpret / memory.rs
index ac4d1c74b8cc1296d8e15eab450cc600ebabfa08..2765feb23f1b906368b2578574e5742a211ae176 100644 (file)
@@ -763,6 +763,7 @@ pub fn read_scalar(&self, ptr: Pointer, ptr_align: Align, size: Size) -> EvalRes
         // Undef check happens *after* we established that the alignment is correct.
         // We must not return Ok() for unaligned pointers!
         if self.check_defined(ptr, size).is_err() {
+            // this inflates undefined bytes to the entire scalar, even if only a few bytes are undefined
             return Ok(Scalar::undef().into());
         }
         // Now we do the actual reading