From 2ca9a54daaa0a955dabf38862cd777be359252e0 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 15 Nov 2025 19:53:47 +0100 Subject: ir: 'trap' jump; c: __builtin_trap; lex: __has_builtin --- amd64/emit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'amd64') diff --git a/amd64/emit.c b/amd64/emit.c index d61c1d3..3cae23f 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -1317,6 +1317,8 @@ emitbin(struct function *fn) if (usebp) B(0xC9); /* leave */ B(0xC3); /* ret */ } + } else if (blk->jmp.t == Jtrap) { + DS("\x0F\x0B"); /* UD2 */ } else emitbranch(pcode, blk); } while ((blk = blk->lnext) != fn->entry); objdeffunc(fn->name, fn->globl, fnstart - objout.textbegin, *pcode - fnstart); -- cgit v1.2.3