summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/lcode.c')
-rw-r--r--apps/plugins/lua/lcode.c16
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
661static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { 653static 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) {