Remove wrongly emitted .eh_frame
in -Cpanic=abort
This commit is contained in:
parent
b2807b2bf3
commit
d9531a0d93
3 changed files with 26 additions and 1 deletions
|
@ -9,6 +9,7 @@ use rustc_middle::mir::{
|
|||
};
|
||||
use rustc_middle::ty::{Ty, TyCtxt, TypeAndMut};
|
||||
use rustc_session::Session;
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
|
||||
pub struct CheckAlignment;
|
||||
|
||||
|
@ -236,7 +237,11 @@ fn insert_alignment_check<'tcx>(
|
|||
required: Operand::Copy(alignment),
|
||||
found: Operand::Copy(addr),
|
||||
}),
|
||||
unwind: UnwindAction::Terminate,
|
||||
unwind: if tcx.sess.panic_strategy() == PanicStrategy::Unwind {
|
||||
UnwindAction::Terminate
|
||||
} else {
|
||||
UnwindAction::Unreachable
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue