summaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-22 13:54:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-22 13:54:31 -0300
commit00af2faae71e6388ee61ef18b2c5902a42e9bc27 (patch)
tree9aa58a3fb85e9ba665578bbb6c669ef3149ef56e /ldebug.c
parente9ef7ed2d3015ff6083ae51995b153b88837b64d (diff)
downloadlua-00af2faae71e6388ee61ef18b2c5902a42e9bc27.tar.gz
lua-00af2faae71e6388ee61ef18b2c5902a42e9bc27.tar.bz2
lua-00af2faae71e6388ee61ef18b2c5902a42e9bc27.zip
first implementation of proper tail call
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ldebug.c b/ldebug.c
index 26b24df1..34b3eec5 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.102 2002/03/11 12:45:00 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.103 2002/03/19 12:45:25 roberto Exp roberto $
3** Debug Interface 3** Debug Interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -296,6 +296,7 @@ static int checkopenop (const Proto *pt, int pc) {
296 Instruction i = pt->code[pc+1]; 296 Instruction i = pt->code[pc+1];
297 switch (GET_OPCODE(i)) { 297 switch (GET_OPCODE(i)) {
298 case OP_CALL: 298 case OP_CALL:
299 case OP_TAILCALL:
299 case OP_RETURN: { 300 case OP_RETURN: {
300 check(GETARG_B(i) == 0); 301 check(GETARG_B(i) == 0);
301 return 1; 302 return 1;
@@ -405,6 +406,7 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
405 if (reg >= a) last = pc; /* affect all registers above base */ 406 if (reg >= a) last = pc; /* affect all registers above base */
406 break; 407 break;
407 } 408 }
409 case OP_TAILCALL:
408 case OP_RETURN: { 410 case OP_RETURN: {
409 b--; /* b = num. returns */ 411 b--; /* b = num. returns */
410 if (b > 0) checkreg(pt, a+b-1); 412 if (b > 0) checkreg(pt, a+b-1);