diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-08-02 14:14:48 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-08-02 14:14:48 -0300 |
| commit | fd4b4a2a68992259ffd91299f68b41de4759d8f0 (patch) | |
| tree | 318f2c54993e7b94c83c7f1bda80b7786d0d8ed7 | |
| parent | d447945685986f0b1a7bd5d7ed7746bf4ebd5914 (diff) | |
| download | lua-fd4b4a2a68992259ffd91299f68b41de4759d8f0.tar.gz lua-fd4b4a2a68992259ffd91299f68b41de4759d8f0.tar.bz2 lua-fd4b4a2a68992259ffd91299f68b41de4759d8f0.zip | |
detail: registry._PRELOAD must be a table, no need to check
| -rw-r--r-- | loadlib.c | 4 |
1 files changed, 1 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: loadlib.c,v 1.88 2010/07/25 15:03:37 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.89 2010/07/28 15:51:59 roberto Exp roberto $ |
| 3 | ** Dynamic library loader for Lua | 3 | ** Dynamic library loader for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | ** | 5 | ** |
| @@ -428,8 +428,6 @@ static int loader_Croot (lua_State *L) { | |||
| 428 | static int loader_preload (lua_State *L) { | 428 | static int loader_preload (lua_State *L) { |
| 429 | const char *name = luaL_checkstring(L, 1); | 429 | const char *name = luaL_checkstring(L, 1); |
| 430 | lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD"); | 430 | lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD"); |
| 431 | if (!lua_istable(L, -1)) | ||
| 432 | luaL_error(L, LUA_QL("package.preload") " must be a table"); | ||
| 433 | lua_getfield(L, -1, name); | 431 | lua_getfield(L, -1, name); |
| 434 | if (lua_isnil(L, -1)) /* not found? */ | 432 | if (lua_isnil(L, -1)) /* not found? */ |
| 435 | lua_pushfstring(L, "\n\tno field package.preload['%s']", name); | 433 | lua_pushfstring(L, "\n\tno field package.preload['%s']", name); |
