From 616438fe9ab5e3ae7d73e9ad838e9b7bdea1ea59 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy <roberto@inf.puc-rio.br> Date: Mon, 31 May 2004 15:51:50 -0300 Subject: new way to use `vararg' parameters (with `...') --- ldebug.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 3a1509f0..044eb57f 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.3 2004/03/23 13:10:16 roberto Exp roberto $ +** $Id: ldebug.c,v 2.4 2004/04/30 20:13:38 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -221,8 +221,8 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { } else if (ar->i_ci != 0) { /* no tail call? */ CallInfo *ci = L->base_ci + ar->i_ci; - lua_assert(ttisfunction(ci->base - 1)); - status = auxgetinfo(L, what, ar, ci->base - 1, ci); + lua_assert(ttisfunction(ci->func)); + status = auxgetinfo(L, what, ar, ci->func, ci); } else info_tailcall(L, ar); @@ -405,6 +405,13 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { } break; } + case OP_VARARG: { + check(pt->is_vararg & NEWSTYLEVARARG); + b--; + if (b == LUA_MULTRET) check(checkopenop(pt, pc)); + checkreg(pt, a+b-1); + break; + } default: break; } } -- cgit v1.2.3-55-g6feb