summaryrefslogtreecommitdiff
path: root/src/lcode.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-02 08:18:58 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-02 08:41:10 +0100
commit5a0db9d250115470589d23cd8ad4b28982cabe06 (patch)
tree826abfddef4491068e776bde83b0cc877627389c /src/lcode.js
parent3e16f28d4eb8691296f4b93588186099474566f4 (diff)
downloadfengari-5a0db9d250115470589d23cd8ad4b28982cabe06.tar.gz
fengari-5a0db9d250115470589d23cd8ad4b28982cabe06.tar.bz2
fengari-5a0db9d250115470589d23cd8ad4b28982cabe06.zip
[Parsing tests] LE, JMP, LT, EQ
Diffstat (limited to 'src/lcode.js')
-rw-r--r--src/lcode.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lcode.js b/src/lcode.js
index 7fd958e..c4b8b81 100644
--- a/src/lcode.js
+++ b/src/lcode.js
@@ -191,7 +191,7 @@ const fixjump = function(fs, pc, dest) {
** Concatenate jump-list 'l2' into jump-list 'l1'
*/
const luaK_concat = function(fs, l1, l2) {
- if (l2 === NO_JUMP) return; /* nothing to concatenate? */
+ if (l2 === NO_JUMP) return l1; /* nothing to concatenate? */
else if (l1 === NO_JUMP) /* no original list? */
l1 = l2;
else {
@@ -1063,7 +1063,15 @@ const codebinexpval = function(fs, op, e1, e2, line) {
*/
const codecomp = function(fs, opr, e1, e2) {
let ek = lparser.expkind;
- let rk1 = (e1.k === ek.VK) ? lopcode.RKASK(e1.u.info) : llimit.check_exp(e1.k === ek.VNONRELOC, e1.u.info);
+
+ let rk1;
+ if (e1.k === ek.VK)
+ rk1 = lopcode.RKASK(e1.u.info);
+ else {
+ assert(e1.k === ek.VNONRELOC);
+ rk1 = e1.u.info;
+ }
+
let rk2 = luaK_exp2RK(fs, e2);
freeexps(fs, e1, e2);
switch (opr) {