Skip to content

Commit

Permalink
Fix workaround for the int $$0x29 issue to not crash on empty inlin…
Browse files Browse the repository at this point in the history
…e asm
  • Loading branch information
bjorn3 committed Nov 2, 2023
1 parent 04f1024 commit c04ceb4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/inline_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ pub(crate) fn codegen_inline_asm<'tcx>(
// Used by panic_abort on Windows, but uses a syntax which only happens to work with
// asm!() by accident and breaks with the GNU assembler as well as global_asm!() for
// the LLVM backend.
if template[0] == InlineAsmTemplatePiece::String("int $$0x29".to_string()) {
if template.len() == 1
&& template[0] == InlineAsmTemplatePiece::String("int $$0x29".to_string())
{
fx.bcx.ins().trap(TrapCode::User(1));
return;
}
Expand Down

0 comments on commit c04ceb4

Please sign in to comment.