diff options
author | William Wilgus <me.theuser@yahoo.com> | 2018-11-08 11:32:45 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-11-11 19:42:30 -0500 |
commit | b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1 (patch) | |
tree | 191277cab3ef773238c1e91dafaaea04ddca1949 /apps/plugins/lua/lcode.c | |
parent | de6618a2713ef26f888762cbe6539cc65a393c7c (diff) | |
download | rockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.tar.gz rockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.zip |
lua update to 5.1.5
Modify Rocklua towards upstream 5.1.5
Clean up some of the Rocklua implementation
Change-Id: Iac722e827899cf84f5ca004ef7ae7ddce5f7fbbe
Diffstat (limited to 'apps/plugins/lua/lcode.c')
-rw-r--r-- | apps/plugins/lua/lcode.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/apps/plugins/lua/lcode.c b/apps/plugins/lua/lcode.c index cc26ac7521..07f9cbe4c4 100644 --- a/apps/plugins/lua/lcode.c +++ b/apps/plugins/lua/lcode.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ | 2 | ** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -544,10 +544,6 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) { | |||
544 | pc = NO_JUMP; /* always true; do nothing */ | 544 | pc = NO_JUMP; /* always true; do nothing */ |
545 | break; | 545 | break; |
546 | } | 546 | } |
547 | case VFALSE: { | ||
548 | pc = luaK_jump(fs); /* always jump */ | ||
549 | break; | ||
550 | } | ||
551 | case VJMP: { | 547 | case VJMP: { |
552 | invertjump(fs, e); | 548 | invertjump(fs, e); |
553 | pc = e->u.s.info; | 549 | pc = e->u.s.info; |
@@ -572,10 +568,6 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) { | |||
572 | pc = NO_JUMP; /* always false; do nothing */ | 568 | pc = NO_JUMP; /* always false; do nothing */ |
573 | break; | 569 | break; |
574 | } | 570 | } |
575 | case VTRUE: { | ||
576 | pc = luaK_jump(fs); /* always jump */ | ||
577 | break; | ||
578 | } | ||
579 | case VJMP: { | 571 | case VJMP: { |
580 | pc = e->u.s.info; | 572 | pc = e->u.s.info; |
581 | break; | 573 | break; |
@@ -641,10 +633,10 @@ static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { | |||
641 | case OP_ADD: r = luai_numadd(v1, v2); break; | 633 | case OP_ADD: r = luai_numadd(v1, v2); break; |
642 | case OP_SUB: r = luai_numsub(v1, v2); break; | 634 | case OP_SUB: r = luai_numsub(v1, v2); break; |
643 | case OP_MUL: r = luai_nummul(v1, v2); break; | 635 | case OP_MUL: r = luai_nummul(v1, v2); break; |
644 | case OP_DIV: | 636 | case OP_DIV: /* ROCKLUA BUGFIX */ |
645 | if (v2 == 0) return -1; /* do not attempt to divide by 0 */ | 637 | if (v2 == 0) return -1; /* do not attempt to divide by 0 */ |
646 | r = luai_numdiv(v1, v2); break; | 638 | r = luai_numdiv(v1, v2); break; |
647 | case OP_MOD: | 639 | case OP_MOD: /* ROCKLUA BUGFIX */ |
648 | if (v2 == 0) return -1; /* do not attempt to divide by 0 */ | 640 | if (v2 == 0) return -1; /* do not attempt to divide by 0 */ |
649 | r = luai_nummod(v1, v2); break; | 641 | r = luai_nummod(v1, v2); break; |
650 | case OP_POW: r = luai_numpow(v1, v2); break; | 642 | case OP_POW: r = luai_numpow(v1, v2); break; |
@@ -659,7 +651,7 @@ static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { | |||
659 | 651 | ||
660 | 652 | ||
661 | static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { | 653 | static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { |
662 | int resf = constfolding(op, e1, e2); | 654 | int resf = constfolding(op, e1, e2); /* ROCKLUA BUGFIX */ |
663 | if (resf > 0) | 655 | if (resf > 0) |
664 | return; | 656 | return; |
665 | else if (resf == 0) { | 657 | else if (resf == 0) { |