aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bugs53
1 files changed, 51 insertions, 2 deletions
diff --git a/bugs b/bugs
index 1dd8e599..e76692b0 100644
--- a/bugs
+++ b/bugs
@@ -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
2032Bug{
2033what = [['module' may change the environment of a C function]],
2034report = [[Peter Cawley, on 2008/07/16]],
2035since = [[5.1]],
2036example = [[
2037pcall(module, "xuxu")
2038assert(debug.getfenv(pcall) == xuxu)
2039]],
2040patch = [[
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
2061Bug{
2062what = [[internal macro 'svalue' is wrong]],
2063report = [["Martijn van Buul, on 2008/08/04]],
2064since = [[5.1]],
2065example = [[
2066/* in luaconf.h */
2067#define LUAI_USER_ALIGNMENT_T union { char b[32]; }
2068]],
2069patch = [[
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