diff options
-rw-r--r-- | bugs | 53 |
1 files changed, 51 insertions, 2 deletions
@@ -1880,8 +1880,8 @@ patch = [[ | |||
1880 | +++ lundump.c 2008/04/04 19:51:41 2.7.1.4 | 1880 | +++ lundump.c 2008/04/04 19:51:41 2.7.1.4 |
1881 | @@ -1,5 +1,5 @@ | 1881 | @@ -1,5 +1,5 @@ |
1882 | /* | 1882 | /* |
1883 | -** $Id: bugs,v 1.96 2008/05/08 16:55:08 roberto Exp roberto $ | 1883 | -** $Id: bugs,v 1.97 2008/07/11 17:27:41 roberto Exp roberto $ |
1884 | +** $Id: bugs,v 1.96 2008/05/08 16:55:08 roberto Exp roberto $ | 1884 | +** $Id: bugs,v 1.97 2008/07/11 17:27:41 roberto Exp roberto $ |
1885 | ** load precompiled Lua chunks | 1885 | ** load precompiled Lua chunks |
1886 | ** See Copyright Notice in lua.h | 1886 | ** See Copyright Notice in lua.h |
1887 | */ | 1887 | */ |
@@ -2028,3 +2028,52 @@ patch = [[ | |||
2028 | ]], | 2028 | ]], |
2029 | } | 2029 | } |
2030 | 2030 | ||
2031 | |||
2032 | Bug{ | ||
2033 | what = [['module' may change the environment of a C function]], | ||
2034 | report = [[Peter Cawley, on 2008/07/16]], | ||
2035 | since = [[5.1]], | ||
2036 | example = [[ | ||
2037 | pcall(module, "xuxu") | ||
2038 | assert(debug.getfenv(pcall) == xuxu) | ||
2039 | ]], | ||
2040 | patch = [[ | ||
2041 | --- loadlib.c 2007/12/28 14:58:43 1.52.1.2 | ||
2042 | +++ loadlib.c 2008/08/05 19:39:00 | ||
2043 | @@ -506,8 +506,11 @@ | ||
2044 | |||
2045 | static void setfenv (lua_State *L) { | ||
2046 | lua_Debug ar; | ||
2047 | - lua_getstack(L, 1, &ar); | ||
2048 | - lua_getinfo(L, "f", &ar); | ||
2049 | + if (lua_getstack(L, 1, &ar) == 0 || | ||
2050 | + lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ | ||
2051 | + lua_iscfunction(L, -1)) | ||
2052 | + luaL_error(L, "function " LUA_QL("module") | ||
2053 | + " not called from a Lua function"); | ||
2054 | lua_pushvalue(L, -2); | ||
2055 | lua_setfenv(L, -2); | ||
2056 | lua_pop(L, 1); | ||
2057 | ]], | ||
2058 | } | ||
2059 | |||
2060 | |||
2061 | Bug{ | ||
2062 | what = [[internal macro 'svalue' is wrong]], | ||
2063 | report = [["Martijn van Buul, on 2008/08/04]], | ||
2064 | since = [[5.1]], | ||
2065 | example = [[ | ||
2066 | /* in luaconf.h */ | ||
2067 | #define LUAI_USER_ALIGNMENT_T union { char b[32]; } | ||
2068 | ]], | ||
2069 | patch = [[ | ||
2070 | --- lobject.h 2007/12/27 13:02:25 2.20.1.1 | ||
2071 | +++ lobject.h 2008/08/05 19:40:48 | ||
2072 | @@ -210,3 +210,3 @@ | ||
2073 | #define getstr(ts) cast(const char *, (ts) + 1) | ||
2074 | -#define svalue(o) getstr(tsvalue(o)) | ||
2075 | +#define svalue(o) getstr(rawtsvalue(o)) | ||
2076 | |||
2077 | ]], | ||
2078 | } | ||
2079 | |||