aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lcode.c b/lcode.c
index feaad660..b8ba2a98 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.23 2005/11/25 13:29:32 roberto Exp roberto $ 2** $Id: lcode.c,v 2.24 2005/12/22 16:19:56 roberto Exp roberto $
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*/
@@ -731,17 +731,15 @@ void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {
731 case OPR_AND: { 731 case OPR_AND: {
732 lua_assert(e1->t == NO_JUMP); /* list must be closed */ 732 lua_assert(e1->t == NO_JUMP); /* list must be closed */
733 luaK_dischargevars(fs, e2); 733 luaK_dischargevars(fs, e2);
734 luaK_concat(fs, &e1->f, e2->f); 734 luaK_concat(fs, &e2->f, e1->f);
735 e1->k = e2->k; e1->u.s.info = e2->u.s.info; 735 *e1 = *e2;
736 e1->u.s.aux = e2->u.s.aux; e1->t = e2->t;
737 break; 736 break;
738 } 737 }
739 case OPR_OR: { 738 case OPR_OR: {
740 lua_assert(e1->f == NO_JUMP); /* list must be closed */ 739 lua_assert(e1->f == NO_JUMP); /* list must be closed */
741 luaK_dischargevars(fs, e2); 740 luaK_dischargevars(fs, e2);
742 luaK_concat(fs, &e1->t, e2->t); 741 luaK_concat(fs, &e2->t, e1->t);
743 e1->k = e2->k; e1->u.s.info = e2->u.s.info; 742 *e1 = *e2;
744 e1->u.s.aux = e2->u.s.aux; e1->f = e2->f;
745 break; 743 break;
746 } 744 }
747 case OPR_CONCAT: { 745 case OPR_CONCAT: {
@@ -750,7 +748,7 @@ void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {
750 lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1); 748 lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1);
751 freeexp(fs, e1); 749 freeexp(fs, e1);
752 SETARG_B(getcode(fs, e2), e1->u.s.info); 750 SETARG_B(getcode(fs, e2), e1->u.s.info);
753 e1->k = e2->k; e1->u.s.info = e2->u.s.info; 751 e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info;
754 } 752 }
755 else { 753 else {
756 luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ 754 luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */