Fix MSVC build
This commit is contained in:
parent
bf6b84b10a
commit
de3f8a1578
@ -1615,7 +1615,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||||||
let cp_llbb = Bx::append_block(self.cx, self.llfn, "cp_terminate");
|
let cp_llbb = Bx::append_block(self.cx, self.llfn, "cp_terminate");
|
||||||
|
|
||||||
let mut cs_bx = Bx::build(self.cx, llbb);
|
let mut cs_bx = Bx::build(self.cx, llbb);
|
||||||
let cs = cs_bx.catch_switch(None, None, &[llbb]);
|
let cs = cs_bx.catch_switch(None, None, &[cp_llbb]);
|
||||||
|
|
||||||
// The "null" here is actually a RTTI type descriptor for the
|
// The "null" here is actually a RTTI type descriptor for the
|
||||||
// C++ personality function, but `catch (...)` has no type so
|
// C++ personality function, but `catch (...)` has no type so
|
||||||
|
@ -166,7 +166,9 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
|||||||
let start_llbb = Bx::append_block(cx, llfn, "start");
|
let start_llbb = Bx::append_block(cx, llfn, "start");
|
||||||
let mut start_bx = Bx::build(cx, start_llbb);
|
let mut start_bx = Bx::build(cx, start_llbb);
|
||||||
|
|
||||||
if mir.basic_blocks.iter().any(|bb| bb.is_cleanup) {
|
if mir.basic_blocks.iter().any(|bb| {
|
||||||
|
bb.is_cleanup || matches!(bb.terminator().unwind(), Some(mir::UnwindAction::Terminate))
|
||||||
|
}) {
|
||||||
start_bx.set_personality_fn(cx.eh_personality());
|
start_bx.set_personality_fn(cx.eh_personality());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user