From 1c0ac3c0f53720c53dcfae13308b11b29dca38e4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 5 Aug 2002 14:35:45 -0300 Subject: [PATCH] new implementation for tailcall --- lparser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lparser.c b/lparser.c index 6285d6b6..bca90809 100644 --- 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 */ }