File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -45,19 +45,21 @@ pub(crate) fn codegen_inline_asm<'tcx>(
4545) {
4646 // FIXME add .eh_frame unwind info directives
4747
48+ // Used by panic_abort on Windows, but uses a syntax which only happens to work with
49+ // asm!() by accident and breaks with the GNU assembler as well as global_asm!() for
50+ // the LLVM backend.
51+ if template[ 0 ] == InlineAsmTemplatePiece :: String ( "int $$0x29" . to_string ( ) ) {
52+ fx. bcx . ins ( ) . trap ( TrapCode :: User ( 1 ) ) ;
53+ return ;
54+ }
55+
4856 if !asm_supported ( fx. tcx ) {
4957 if template. is_empty ( ) {
5058 let destination_block = fx. get_block ( destination. unwrap ( ) ) ;
5159 fx. bcx . ins ( ) . jump ( destination_block, & [ ] ) ;
5260 return ;
5361 }
5462
55- // Used by panic_abort
56- if template[ 0 ] == InlineAsmTemplatePiece :: String ( "int $$0x29" . to_string ( ) ) {
57- fx. bcx . ins ( ) . trap ( TrapCode :: User ( 1 ) ) ;
58- return ;
59- }
60-
6163 // Used by stdarch
6264 if template[ 0 ] == InlineAsmTemplatePiece :: String ( "mov " . to_string ( ) )
6365 && matches ! (
You can’t perform that action at this time.
0 commit comments