about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/const_eval
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2022-11-10 11:37:28 -0500
committerBen Kimock <kimockb@gmail.com>2023-03-23 18:23:06 -0400
commit8ccf53332e2ab70fa4efed5716ddcbb61e98dac2 (patch)
tree632b4dfa8f9fcdc21d09b8fa93312d0f6a306b00 /compiler/rustc_const_eval/src/const_eval
parente2163008763c326ec4003e07b8e6eef0c98f6204 (diff)
downloadrust-8ccf53332e2ab70fa4efed5716ddcbb61e98dac2.tar.gz
rust-8ccf53332e2ab70fa4efed5716ddcbb61e98dac2.zip
A MIR transform that checks pointers are aligned
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/machine.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs
index 350ce529ef5..c87ea18af4f 100644
--- a/compiler/rustc_const_eval/src/const_eval/machine.rs
+++ b/compiler/rustc_const_eval/src/const_eval/machine.rs
@@ -544,6 +544,12 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
             RemainderByZero(op) => RemainderByZero(eval_to_int(op)?),
             ResumedAfterReturn(generator_kind) => ResumedAfterReturn(*generator_kind),
             ResumedAfterPanic(generator_kind) => ResumedAfterPanic(*generator_kind),
+            MisalignedPointerDereference { ref required, ref found } => {
+                MisalignedPointerDereference {
+                    required: eval_to_int(required)?,
+                    found: eval_to_int(found)?,
+                }
+            }
         };
         Err(ConstEvalErrKind::AssertFailure(err).into())
     }