Fix workaround for the `int $$0x29` issue to not crash on empty inlin… · rust-lang/rust@c04ceb4

Original file line numberDiff line numberDiff line change

@@ -47,7 +47,9 @@ pub(crate) fn codegen_inline_asm<'tcx>(

4747

// Used by panic_abort on Windows, but uses a syntax which only happens to work with

4848

// asm!() by accident and breaks with the GNU assembler as well as global_asm!() for

4949

// 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+

{

5153

fx.bcx.ins().trap(TrapCode::User(1));

5254

return;

5355

}