Fix workaround for the int <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow></mrow><annotation encoding="application/x-tex"></annotation></semantics></math></span><span class="katex-html" aria-hidden="true"></span></span>0x29
issue to not crash on empty inlin… · rust-lang/rust@c04ceb4 (original) (raw)
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -47,7 +47,9 @@ pub(crate) fn codegen_inline_asm<'tcx>( | ||
47 | 47 | // Used by panic_abort on Windows, but uses a syntax which only happens to work with |
48 | 48 | // asm!() by accident and breaks with the GNU assembler as well as global_asm!() for |
49 | 49 | // the LLVM backend. |
50 | -if template[0] == InlineAsmTemplatePiece::String("int 0x29".to_string()) { | |
50 | +if template.len() == 1 | |
51 | + && template[0] == InlineAsmTemplatePiece::String("int 0x29".to_string()) | |
52 | +{ | |
51 | 53 | fx.bcx.ins().trap(TrapCode::User(1)); |
52 | 54 | return; |
53 | 55 | } |