changeset 522:01bdad2118aa

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.
author William Astle <lost@l-w.ca>
date Sun, 02 Jan 2022 00:59:21 -0700
parents 56c32bc798f8
children 1744f2d1a821
files lwasm/insn_tfm.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }