Skip to content

Commit

Permalink
cg_cranelift: check may_unwind flag instead of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cynecx committed Dec 3, 2021
1 parent 5728c16 commit dd3cb0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/base.rs
@@ -1,6 +1,7 @@
//! Codegen of a single function

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

0 comments on commit dd3cb0c

Please sign in to comment.