summaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-02-19 10:48:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-02-19 10:48:53 -0300
commita4c6dcf999ddea865e295ea34926a838a1f97b61 (patch)
treeb539e4004df0caa7b1a37ccffe3754c3e4f3fa23 /lauxlib.c
parent3f78de256e5759669460c6fa14455303762f2f53 (diff)
downloadlua-github-a4c6dcf999ddea865e295ea34926a838a1f97b61.tar.gz
detail (better error messages for light userdata)
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 5da1a38c..06f02f6f 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lauxlib.c,v 1.257 2014/02/05 19:14:53 roberto Exp roberto $
+** $Id: lauxlib.c,v 1.258 2014/02/11 17:39:15 roberto Exp roberto $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -176,6 +176,8 @@ static int typeerror (lua_State *L, int arg, const char *tname) {
if (lua_isstring(L, -1))
typearg = lua_tostring(L, -1);
}
+ else if (lua_type(L, arg) == LUA_TLIGHTUSERDATA)
+ typearg = "light userdata";
msg = lua_pushfstring(L, "%s expected, got %s", tname, typearg);
return luaL_argerror(L, arg, msg);
}