diff options
| author | cynecx <me@cynecx.net> | 2021-11-13 00:37:30 +0100 |
|---|---|---|
| committer | cynecx <me@cynecx.net> | 2021-12-03 23:51:49 +0100 |
| commit | b7cb08d4e7a1586b801431f451328821c481cbd3 (patch) | |
| tree | 30a0971207141149a7a85dfc7e736d0d388ec70b | |
| parent | 48fc7d9351662fcd2c41cc64815b6d568698f76d (diff) | |
| download | rust-b7cb08d4e7a1586b801431f451328821c481cbd3.tar.gz rust-b7cb08d4e7a1586b801431f451328821c481cbd3.zip | |
rustc_codegen_gcc: error on unwinding inline asm
| -rw-r--r-- | src/asm.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/asm.rs b/src/asm.rs index 7c3ed3c5ee9..c205a6ed4a2 100644 --- a/src/asm.rs +++ b/src/asm.rs @@ -118,7 +118,14 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> { true } - fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], rust_operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, _span: &[Span], _instance: Instance<'_>) { + fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], rust_operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, span: &[Span], _instance: Instance<'_>, dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>) { + if dest_catch_funclet.is_some() { + self.sess() + .struct_span_err(span[0], "GCC backend does not support unwinding from inline asm") + .emit(); + return; + } + let asm_arch = self.tcx.sess.asm_arch.unwrap(); let is_x86 = matches!(asm_arch, InlineAsmArch::X86 | InlineAsmArch::X86_64); let att_dialect = is_x86 && options.contains(InlineAsmOptions::ATT_SYNTAX); |
