changeset 368:362f8fb0695b

Make psh/pul error out if no registers given While the generated object code was technically correct for bare pshs, puls, pshu, and pulu, it was not helpful. Throw a bad operand error if no registers are given as an operand to such instructions. Thanks to Erik G <erik@6809.org> for reporting the problem.
author William Astle <lost@l-w.ca>
date Mon, 15 Jun 2015 21:26:33 -0600
parents c6d2a1f54e0c
children 682524a1f32f
files lwasm/insn_rlist.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/insn_rlist.c	Mon Jun 15 21:21:58 2015 -0600
+++ b/lwasm/insn_rlist.c	Mon Jun 15 21:26:33 2015 -0600
@@ -55,6 +55,8 @@
 			rn = 1 << rn;
 		rb |= rn;
 	}
+	if (rb == 0)
+		lwasm_register_error(as, l, "Bad operand");
 	l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
 	l -> pb = rb;
 }