lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 1c0ac3c0f53720c53dcfae13308b11b29dca38e4
parent 4a4f2437952e0968c010ea3424c3c1c3df2188c1
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon,  5 Aug 2002 14:35:23 -0300

new implementation for tailcall

Diffstat:
Mlparser.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lparser.c b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 1.189 2002/06/26 16:37:13 roberto Exp roberto $ +** $Id: lparser.c,v 1.190 2002/07/04 18:23:42 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -1166,11 +1166,11 @@ static void retstat (LexState *ls) { else { nret = explist1(ls, &e); /* optional return values */ if (e.k == VCALL) { + luaK_setcallreturns(fs, &e, LUA_MULTRET); if (nret == 1) { /* tail call? */ SET_OPCODE(getcode(fs,&e), OP_TAILCALL); - return; + lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar); } - luaK_setcallreturns(fs, &e, LUA_MULTRET); first = fs->nactvar; nret = LUA_MULTRET; /* return all values */ }