From 00af2faae71e6388ee61ef18b2c5902a42e9bc27 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 22 Mar 2002 13:54:31 -0300 Subject: first implementation of proper tail call --- ldebug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 26b24df1..34b3eec5 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 1.102 2002/03/11 12:45:00 roberto Exp roberto $ +** $Id: ldebug.c,v 1.103 2002/03/19 12:45:25 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -296,6 +296,7 @@ static int checkopenop (const Proto *pt, int pc) { Instruction i = pt->code[pc+1]; switch (GET_OPCODE(i)) { case OP_CALL: + case OP_TAILCALL: case OP_RETURN: { check(GETARG_B(i) == 0); return 1; @@ -405,6 +406,7 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { if (reg >= a) last = pc; /* affect all registers above base */ break; } + case OP_TAILCALL: case OP_RETURN: { b--; /* b = num. returns */ if (b > 0) checkreg(pt, a+b-1); -- cgit v1.2.3-55-g6feb