From e1725c0cdd15d7fea5beefec24759cc15825ead1 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 16 Aug 2015 12:39:50 -0400 Subject: make sure tests emitted are encodable --- lisc/isel.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisc/isel.c') diff --git a/lisc/isel.c b/lisc/isel.c index 4f6b054..c36773c 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -333,6 +333,11 @@ seljmp(Blk *b, Fn *fn) fi->op = OXTestw; fi->to = R; b->jmp.type = JXJc + Cne; + if (rtype(fi->arg[1]) == RCon) { + r = fi->arg[1]; + fi->arg[1] = fi->arg[0]; + fi->arg[0] = r; + } return; } if (fn->tmp[r.val].nuse > 1) { -- cgit 1.4.1