11/*
2- ** $Id: lcode.c,v 2.142 2017/12/04 17:41:30 roberto Exp roberto $
2+ ** $Id: lcode.c,v 2.143 2017/12/13 18:32:09 roberto Exp roberto $
33** Code generator for Lua
44** See Copyright Notice in lua.h
55*/
@@ -632,7 +632,7 @@ void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {
632632** vararg), it already returns one result, so nothing needs to be done.
633633** Function calls become VNONRELOC expressions (as its result comes
634634** fixed in the base register of the call), while vararg expressions
635- ** become VRELOCABLE (as OP_VARARG puts its results where it wants).
635+ ** become VRELOC (as OP_VARARG puts its results where it wants).
636636** (Calls are created returning one result, so that does not need
637637** to be fixed.)
638638*/
@@ -645,7 +645,7 @@ void luaK_setoneret (FuncState *fs, expdesc *e) {
645645 }
646646 else if (e -> k == VVARARG ) {
647647 SETARG_B (getinstruction (fs , e ), 2 );
648- e -> k = VRELOCABLE ; /* can relocate its simple result */
648+ e -> k = VRELOC ; /* can relocate its simple result */
649649 }
650650}
651651
@@ -661,30 +661,30 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) {
661661 }
662662 case VUPVAL : { /* move value to some (pending) register */
663663 e -> u .info = luaK_codeABC (fs , OP_GETUPVAL , 0 , e -> u .info , 0 );
664- e -> k = VRELOCABLE ;
664+ e -> k = VRELOC ;
665665 break ;
666666 }
667667 case VINDEXUP : {
668668 e -> u .info = luaK_codeABC (fs , OP_GETTABUP , 0 , e -> u .ind .t , e -> u .ind .idx );
669- e -> k = VRELOCABLE ;
669+ e -> k = VRELOC ;
670670 break ;
671671 }
672672 case VINDEXI : {
673673 freereg (fs , e -> u .ind .t );
674674 e -> u .info = luaK_codeABC (fs , OP_GETI , 0 , e -> u .ind .t , e -> u .ind .idx );
675- e -> k = VRELOCABLE ;
675+ e -> k = VRELOC ;
676676 break ;
677677 }
678678 case VINDEXSTR : {
679679 freereg (fs , e -> u .ind .t );
680680 e -> u .info = luaK_codeABC (fs , OP_GETFIELD , 0 , e -> u .ind .t , e -> u .ind .idx );
681- e -> k = VRELOCABLE ;
681+ e -> k = VRELOC ;
682682 break ;
683683 }
684684 case VINDEXED : {
685685 freeregs (fs , e -> u .ind .t , e -> u .ind .idx );
686686 e -> u .info = luaK_codeABC (fs , OP_GETTABLE , 0 , e -> u .ind .t , e -> u .ind .idx );
687- e -> k = VRELOCABLE ;
687+ e -> k = VRELOC ;
688688 break ;
689689 }
690690 case VVARARG : case VCALL : {
@@ -723,7 +723,7 @@ static void discharge2reg (FuncState *fs, expdesc *e, int reg) {
723723 luaK_int (fs , reg , e -> u .ival );
724724 break ;
725725 }
726- case VRELOCABLE : {
726+ case VRELOC : {
727727 Instruction * pc = & getinstruction (fs , e );
728728 SETARG_A (* pc , reg ); /* instruction will put result in 'reg' */
729729 break ;
@@ -963,7 +963,7 @@ static void negatecondition (FuncState *fs, expdesc *e) {
963963** and removing the 'not'.
964964*/
965965static int jumponcond (FuncState * fs , expdesc * e , int cond ) {
966- if (e -> k == VRELOCABLE ) {
966+ if (e -> k == VRELOC ) {
967967 Instruction ie = getinstruction (fs , e );
968968 if (GET_OPCODE (ie ) == OP_NOT ) {
969969 fs -> pc -- ; /* remove previous OP_NOT */
@@ -1048,12 +1048,12 @@ static void codenot (FuncState *fs, expdesc *e) {
10481048 negatecondition (fs , e );
10491049 break ;
10501050 }
1051- case VRELOCABLE :
1051+ case VRELOC :
10521052 case VNONRELOC : {
10531053 discharge2anyreg (fs , e );
10541054 freeexp (fs , e );
10551055 e -> u .info = luaK_codeABC (fs , OP_NOT , 0 , e -> u .info , 0 );
1056- e -> k = VRELOCABLE ;
1056+ e -> k = VRELOC ;
10571057 break ;
10581058 }
10591059 default : lua_assert (0 ); /* cannot happen */
@@ -1191,7 +1191,7 @@ static void codeunexpval (FuncState *fs, OpCode op, expdesc *e, int line) {
11911191 int r = luaK_exp2anyreg (fs , e ); /* opcodes operate only on registers */
11921192 freeexp (fs , e );
11931193 e -> u .info = luaK_codeABC (fs , op , 0 , r , 0 ); /* generate opcode */
1194- e -> k = VRELOCABLE ; /* all those operations are relocatable */
1194+ e -> k = VRELOC ; /* all those operations are relocatable */
11951195 luaK_fixline (fs , line );
11961196}
11971197
@@ -1200,7 +1200,7 @@ static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2,
12001200 int pc , int line ) {
12011201 freeexps (fs , e1 , e2 );
12021202 e1 -> u .info = pc ;
1203- e1 -> k = VRELOCABLE ; /* all those operations are relocatable */
1203+ e1 -> k = VRELOC ; /* all those operations are relocatable */
12041204 luaK_fixline (fs , line );
12051205}
12061206
@@ -1474,12 +1474,12 @@ void luaK_posfix (FuncState *fs, BinOpr opr,
14741474 }
14751475 case OPR_CONCAT : {
14761476 luaK_exp2val (fs , e2 );
1477- if (e2 -> k == VRELOCABLE &&
1477+ if (e2 -> k == VRELOC &&
14781478 GET_OPCODE (getinstruction (fs , e2 )) == OP_CONCAT ) {
14791479 lua_assert (e1 -> u .info == GETARG_B (getinstruction (fs , e2 ))- 1 );
14801480 freeexp (fs , e1 );
14811481 SETARG_B (getinstruction (fs , e2 ), e1 -> u .info );
1482- e1 -> k = VRELOCABLE ; e1 -> u .info = e2 -> u .info ;
1482+ e1 -> k = VRELOC ; e1 -> u .info = e2 -> u .info ;
14831483 }
14841484 else {
14851485 luaK_exp2nextreg (fs , e2 ); /* operand must be on the 'stack' */
0 commit comments