aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'amd64')
-rw-r--r--amd64/emit.c2
1 files changed, 2 insertions, 0 deletions
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);