C upvalues are the last arguments to a function

This commit is contained in:
Roberto Ierusalimschy
2000-08-29 11:33:31 -03:00
parent b691d4344b
commit ac12f4db4b
6 changed files with 74 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lauxlib.c,v 1.30 2000/08/09 19:16:57 roberto Exp roberto $
** $Id: lauxlib.c,v 1.31 2000/08/28 17:57:04 roberto Exp roberto $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -32,8 +32,7 @@ int luaL_findstring (const char *name, const char *const list[]) {
void luaL_argerror (lua_State *L, int narg, const char *extramsg) {
lua_Debug ar;
lua_getstack(L, 0, &ar);
lua_getinfo(L, "nu", &ar);
narg -= ar.nups;
lua_getinfo(L, "n", &ar);
if (ar.name == NULL)
ar.name = "?";
luaL_verror(L, "bad argument #%d to `%.50s' (%.100s)",