Unconditionally handle int $$0x29 using a shim

This commit is contained in:
bjorn3 2023-10-29 16:08:16 +00:00
parent 827a6d8d9f
commit b1e705146a

View file

@ -45,6 +45,14 @@ pub(crate) fn codegen_inline_asm<'tcx>(
) {
// FIXME add .eh_frame unwind info directives
// 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()) {
fx.bcx.ins().trap(TrapCode::User(1));
return;
}
if !asm_supported(fx.tcx) {
if template.is_empty() {
let destination_block = fx.get_block(destination.unwrap());
@ -52,12 +60,6 @@ pub(crate) fn codegen_inline_asm<'tcx>(
return;
}
// Used by panic_abort
if template[0] == InlineAsmTemplatePiece::String("int $$0x29".to_string()) {
fx.bcx.ins().trap(TrapCode::User(1));
return;
}
// Used by stdarch
if template[0] == InlineAsmTemplatePiece::String("mov ".to_string())
&& matches!(