diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2019-10-29 17:31:54 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2019-11-11 15:14:34 -0500 |
| commit | fe88fc03c50be57e1dc12cf308c45dc9c8d6473a (patch) | |
| tree | eff576f45f27f9afa4c17e7736bc83128e4a7a42 /src/librustc_codegen_ssa/mir | |
| parent | caf3cc1fc88430caa61a8f1ae0262c3489a6481a (diff) | |
| download | rust-fe88fc03c50be57e1dc12cf308c45dc9c8d6473a.tar.gz rust-fe88fc03c50be57e1dc12cf308c45dc9c8d6473a.zip | |
Fix up intrinsic implementation
Diffstat (limited to 'src/librustc_codegen_ssa/mir')
| -rw-r--r-- | src/librustc_codegen_ssa/mir/block.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs index 13cd202158b..9361a7c3ea4 100644 --- a/src/librustc_codegen_ssa/mir/block.rs +++ b/src/librustc_codegen_ssa/mir/block.rs @@ -528,6 +528,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { _ => FnAbi::new(&bx, sig, &extra_args) }; + // This should never be reachable at runtime: + // We should only emit a call to this intrinsic in #[cfg(miri)] mode, + // which means that we will never actually use the generate object files + // (we will just be interpreting the MIR) + if intrinsic == Some("miri_start_panic") { + bx.abort(); + bx.unreachable(); + return; + } + // Emit a panic or a no-op for `panic_if_uninhabited`. if intrinsic == Some("panic_if_uninhabited") { let ty = instance.unwrap().substs.type_at(0); |
