Skip to content

Commit

Permalink
Avoid over-aligning the return value in the -Cpanic=abort case
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum authored and Amanieu committed Mar 2, 2020
1 parent d45ce5a commit 1920f81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_codegen_llvm/intrinsic.rs
Expand Up @@ -858,8 +858,10 @@ fn try_intrinsic(
) {
if bx.sess().no_landing_pads() {
bx.call(func, &[data], None);
let ptr_align = bx.tcx().data_layout.pointer_align.abi;
bx.store(bx.const_null(bx.type_i8p()), dest, ptr_align);
// Return 0 unconditionally from the intrinsic call;
// we can never unwind.
let ret_align = bx.tcx().data_layout.i32_align.abi;
bx.store(bx.const_i32(0), dest, ret_align);
} else if wants_msvc_seh(bx.sess()) {
codegen_msvc_try(bx, func, data, local_ptr, dest);
} else {
Expand Down

0 comments on commit 1920f81

Please sign in to comment.