Mercurial > hg > index.cgi
comparison lwasm/insn_tfm.c @ 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 | b20f14edda5a |
children |
comparison
equal
deleted
inserted
replaced
521:56c32bc798f8 | 522:01bdad2118aa |
---|---|
147 { | 147 { |
148 lwasm_register_error(as, l, E_OPERAND_BAD); | 148 lwasm_register_error(as, l, E_OPERAND_BAD); |
149 r0 = r1 = 0; | 149 r0 = r1 = 0; |
150 } | 150 } |
151 } | 151 } |
152 l -> len = instab[l -> insn].ops[0] + 1; | 152 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1; |
153 l -> pb = (r0 << 4) | r1; | 153 l -> pb = (r0 << 4) | r1; |
154 } | 154 } |
155 | 155 |
156 EMITFUNC(insn_emit_tfmrtor) | 156 EMITFUNC(insn_emit_tfmrtor) |
157 { | 157 { |