diff options
-rw-r--r-- | lapi.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.180 2002/03/26 20:46:10 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.181 2002/03/27 12:49:53 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -416,15 +416,13 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { | |||
416 | default: | 416 | default: |
417 | mt = hvalue(defaultmeta(L)); | 417 | mt = hvalue(defaultmeta(L)); |
418 | } | 418 | } |
419 | if (mt == hvalue(defaultmeta(L))) { | 419 | if (mt == hvalue(defaultmeta(L))) |
420 | setnilvalue(L->top); | ||
421 | res = 0; | 420 | res = 0; |
422 | } | ||
423 | else { | 421 | else { |
424 | sethvalue(L->top, mt); | 422 | sethvalue(L->top, mt); |
423 | api_incr_top(L); | ||
425 | res = 1; | 424 | res = 1; |
426 | } | 425 | } |
427 | api_incr_top(L); | ||
428 | lua_unlock(L); | 426 | lua_unlock(L); |
429 | return res; | 427 | return res; |
430 | } | 428 | } |