diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-05-31 15:51:50 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-05-31 15:51:50 -0300 |
| commit | 616438fe9ab5e3ae7d73e9ad838e9b7bdea1ea59 (patch) | |
| tree | 78322d820e3af1ca6645ed08eaa65a8f0aa04fec /ldebug.c | |
| parent | 47eda6ebd83785908ac26f8dd06dff36a7d42664 (diff) | |
| download | lua-616438fe9ab5e3ae7d73e9ad838e9b7bdea1ea59.tar.gz lua-616438fe9ab5e3ae7d73e9ad838e9b7bdea1ea59.tar.bz2 lua-616438fe9ab5e3ae7d73e9ad838e9b7bdea1ea59.zip | |
new way to use `vararg' parameters (with `...')
Diffstat (limited to '')
| -rw-r--r-- | ldebug.c | 13 |
1 files changed, 10 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 2.3 2004/03/23 13:10:16 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.4 2004/04/30 20:13:38 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 | */ |
| @@ -221,8 +221,8 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { | |||
| 221 | } | 221 | } |
| 222 | else if (ar->i_ci != 0) { /* no tail call? */ | 222 | else if (ar->i_ci != 0) { /* no tail call? */ |
| 223 | CallInfo *ci = L->base_ci + ar->i_ci; | 223 | CallInfo *ci = L->base_ci + ar->i_ci; |
| 224 | lua_assert(ttisfunction(ci->base - 1)); | 224 | lua_assert(ttisfunction(ci->func)); |
| 225 | status = auxgetinfo(L, what, ar, ci->base - 1, ci); | 225 | status = auxgetinfo(L, what, ar, ci->func, ci); |
| 226 | } | 226 | } |
| 227 | else | 227 | else |
| 228 | info_tailcall(L, ar); | 228 | info_tailcall(L, ar); |
| @@ -405,6 +405,13 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) { | |||
| 405 | } | 405 | } |
| 406 | break; | 406 | break; |
| 407 | } | 407 | } |
| 408 | case OP_VARARG: { | ||
| 409 | check(pt->is_vararg & NEWSTYLEVARARG); | ||
| 410 | b--; | ||
| 411 | if (b == LUA_MULTRET) check(checkopenop(pt, pc)); | ||
| 412 | checkreg(pt, a+b-1); | ||
| 413 | break; | ||
| 414 | } | ||
| 408 | default: break; | 415 | default: break; |
| 409 | } | 416 | } |
| 410 | } | 417 | } |
