diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-08-16 12:39:50 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:31 -0400 |
commit | e1725c0cdd15d7fea5beefec24759cc15825ead1 (patch) | |
tree | 87b614be2a5ef16aaf7048f9b645fb7add26ec20 | |
parent | ca8c320dec82df1700216a5a040768bfc2d81632 (diff) | |
download | roux-e1725c0cdd15d7fea5beefec24759cc15825ead1.tar.gz |
make sure tests emitted are encodable
-rw-r--r-- | lisc/isel.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |