# HG changeset patch # User Michael Pavone # Date 1504856302 25200 # Node ID ffe45c5b83906148f7f59c1e46836a80872c424b # Parent 63f309cfbef96f3b7fed4d656317d3128baced60 Fix unlk for the a7 case diff -r 63f309cfbef9 -r ffe45c5b8390 m68k_core.c --- a/m68k_core.c Fri Sep 08 00:38:10 2017 -0700 +++ b/m68k_core.c Fri Sep 08 00:38:22 2017 -0700 @@ -284,11 +284,15 @@ static void translate_m68k_unlk(m68k_options * opts, m68kinst * inst) { cycles(&opts->gen, BUS); - areg_to_native(opts, inst->dst.params.regs.pri, opts->aregs[7]); + if (inst->dst.params.regs.pri != 7) { + areg_to_native(opts, inst->dst.params.regs.pri, opts->aregs[7]); + } areg_to_native(opts, 7, opts->gen.scratch1); call(&opts->gen.code, opts->read_32); native_to_areg(opts, opts->gen.scratch1, inst->dst.params.regs.pri); - addi_areg(opts, 4, 7); + if (inst->dst.params.regs.pri != 7) { + addi_areg(opts, 4, 7); + } } static void translate_m68k_link(m68k_options * opts, m68kinst * inst)