aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-20 09:35:25 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-20 09:35:25 -0200
commit515d55683224eb78b8e8c69d3b0c7ed7a7c2076f (patch)
tree41c04984589e0cc746b609a946db23d1d595900b
parented7039024d32778a62fd52a98fe98f3e38133853 (diff)
downloadlua-515d55683224eb78b8e8c69d3b0c7ed7a7c2076f.tar.gz
lua-515d55683224eb78b8e8c69d3b0c7ed7a7c2076f.tar.bz2
lua-515d55683224eb78b8e8c69d3b0c7ed7a7c2076f.zip
access to metamethods and metafields should be raw
-rw-r--r--lauxlib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 84f13cb4..f68c3fba 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.153 2005/10/03 14:36:45 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.154 2005/10/19 13:05:11 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -199,7 +199,8 @@ LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
199LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { 199LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
200 if (!lua_getmetatable(L, obj)) /* no metatable? */ 200 if (!lua_getmetatable(L, obj)) /* no metatable? */
201 return 0; 201 return 0;
202 lua_getfield(L, -1, event); 202 lua_pushstring(L, event);
203 lua_rawget(L, -2);
203 if (lua_isnil(L, -1)) { 204 if (lua_isnil(L, -1)) {
204 lua_pop(L, 2); /* remove metatable and metafield */ 205 lua_pop(L, 2); /* remove metatable and metafield */
205 return 0; 206 return 0;