# HG changeset patch # User William Astle # Date 1641110361 25200 # Node ID 01bdad2118aa33afedab1664c8a864ed936de1c7 # Parent 56c32bc798f89542a27826b6d3323e8e2e810146 Fix instruction length calculation for TFM compatibility operations The compatibility operations for TFM (TFRP, COPY+, etc.) were using the opcode as the length instead of the length of the opcode as the length. This corrects that oversight. Interestingly, this error has been present forever which gives a fair indication that almost nobody uses these compatibility instructions. diff -r 56c32bc798f8 -r 01bdad2118aa lwasm/insn_tfm.c --- a/lwasm/insn_tfm.c Sun Dec 19 17:46:02 2021 -0700 +++ b/lwasm/insn_tfm.c Sun Jan 02 00:59:21 2022 -0700 @@ -149,7 +149,7 @@ r0 = r1 = 0; } } - l -> len = instab[l -> insn].ops[0] + 1; + l -> len = OPLEN(instab[l -> insn].ops[0]) + 1; l -> pb = (r0 << 4) | r1; }