1
Fork 0

cg_cranelift: check may_unwind flag instead of cleanup

This commit is contained in:
cynecx 2021-09-04 22:14:09 +02:00
parent 91021de1f6
commit 6cbf44f1d4

View file

@ -1,6 +1,7 @@
//! Codegen of a single function //! Codegen of a single function
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink}; use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_ast::InlineAsmOptions;
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use rustc_middle::ty::adjustment::PointerCast; use rustc_middle::ty::adjustment::PointerCast;
use rustc_middle::ty::layout::FnAbiOf; use rustc_middle::ty::layout::FnAbiOf;
@ -379,9 +380,9 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, '_>) {
options, options,
destination, destination,
line_spans: _, line_spans: _,
cleanup, cleanup: _,
} => { } => {
if cleanup.is_some() { if options.contains(InlineAsmOptions::MAY_UNWIND) {
fx.tcx.sess.span_fatal( fx.tcx.sess.span_fatal(
source_info.span, source_info.span,
"cranelift doesn't support unwinding from inline assembly.", "cranelift doesn't support unwinding from inline assembly.",