diff options
| author | Ben Kimock <kimockb@gmail.com> | 2022-11-10 11:37:28 -0500 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2023-03-23 18:23:06 -0400 |
| commit | 8ccf53332e2ab70fa4efed5716ddcbb61e98dac2 (patch) | |
| tree | 632b4dfa8f9fcdc21d09b8fa93312d0f6a306b00 /compiler/rustc_const_eval/src/const_eval | |
| parent | e2163008763c326ec4003e07b8e6eef0c98f6204 (diff) | |
| download | rust-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.rs | 6 |
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()) } |
