浏览代码

small bug: debug.getfenv should check whether it has an argument

Roberto Ierusalimschy 16 年之前
父节点
当前提交
ee5d03b42a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      ldblib.c

+ 2 - 1
ldblib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ldblib.c,v 1.109 2008/01/21 13:37:08 roberto Exp roberto $
+** $Id: ldblib.c,v 1.110 2009/02/17 13:21:28 roberto Exp roberto $
 ** Interface from Lua to its debug API
 ** See Copyright Notice in lua.h
 */
@@ -45,6 +45,7 @@ static int db_setmetatable (lua_State *L) {
 
 
 static int db_getfenv (lua_State *L) {
+  luaL_checkany(L, 1);
   lua_getfenv(L, 1);
   return 1;
 }