aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lcode.c b/lcode.c
index d43103fd..3f0418b9 100644
--- a/lcode.c
+++ b/lcode.c
@@ -88,6 +88,16 @@ static void luaK_sub (LexState *ls) {
88} 88}
89 89
90 90
91static void luaK_conc (LexState *ls) {
92 Instruction *previous = previous_instruction(ls);
93 luaK_deltastack(ls, -1);
94 switch(GET_OPCODE(*previous)) {
95 case CONCOP: *previous = SETARG_U(*previous, GETARG_U(*previous)+1); break;
96 default: luaK_primitivecode(ls, CREATE_U(CONCOP, 2));
97 }
98}
99
100
91void luaK_retcode (LexState *ls, int nlocals, int nexps) { 101void luaK_retcode (LexState *ls, int nlocals, int nexps) {
92 Instruction *previous = previous_instruction(ls); 102 Instruction *previous = previous_instruction(ls);
93 if (nexps > 0 && GET_OPCODE(*previous) == CALL) { 103 if (nexps > 0 && GET_OPCODE(*previous) == CALL) {
@@ -286,7 +296,7 @@ void luaK_posfix (LexState *ls, int op, expdesc *v1, expdesc *v2) {
286 case '*': luaK_0(ls, MULTOP, -1); break; 296 case '*': luaK_0(ls, MULTOP, -1); break;
287 case '/': luaK_0(ls, DIVOP, -1); break; 297 case '/': luaK_0(ls, DIVOP, -1); break;
288 case '^': luaK_0(ls, POWOP, -1); break; 298 case '^': luaK_0(ls, POWOP, -1); break;
289 case CONC: luaK_0(ls, CONCOP, -1); break; 299 case CONC: luaK_conc(ls); break;
290 case EQ: luaK_0(ls, EQOP, -1); break; 300 case EQ: luaK_0(ls, EQOP, -1); break;
291 case NE: luaK_0(ls, NEQOP, -1); break; 301 case NE: luaK_0(ls, NEQOP, -1); break;
292 case '>': luaK_0(ls, GTOP, -1); break; 302 case '>': luaK_0(ls, GTOP, -1); break;