Skip to content

Commit 78d9865

Browse files
committed
bugs: Internal Lua values may escape through the debug API +
Problems when yielding from debug hooks
1 parent cc2a60e commit 78d9865

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

bugs

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,8 +1880,8 @@ patch = [[
18801880
+++ lundump.c 2008/04/04 19:51:41 2.7.1.4
18811881
@@ -1,5 +1,5 @@
18821882
/*
1883-
-** $Id: bugs,v 1.113 2012/04/12 16:25:25 roberto Exp roberto $
1884-
+** $Id: bugs,v 1.113 2012/04/12 16:25:25 roberto Exp roberto $
1883+
-** $Id: bugs,v 1.114 2012/05/11 14:10:28 roberto Exp roberto $
1884+
+** $Id: bugs,v 1.114 2012/05/11 14:10:28 roberto Exp roberto $
18851885
** load precompiled Lua chunks
18861886
** See Copyright Notice in lua.h
18871887
*/
@@ -2648,6 +2648,43 @@ patch = [[
26482648
]]
26492649
}
26502650

2651+
Bug{
2652+
what = [[Internal Lua values may escape through the debug API]],
2653+
report = [[Dan Tull, 2012/04/20]],
2654+
since = [[5.1]],
2655+
example = [[
2656+
-- for Lua 5.1
2657+
local firsttime = true
2658+
local function foo ()
2659+
if firsttime then
2660+
firsttime = false
2661+
return "a = 1"
2662+
else
2663+
for i = 1, 10 do
2664+
print(debug.getlocal(2, i))
2665+
end
2666+
end
2667+
end
2668+
2669+
print(load(foo)) -- prints some lines and then seg. fault.
2670+
]],
2671+
patch = [[
2672+
]]
2673+
}
2674+
2675+
Bug{
2676+
what = [[Problems when yielding from debug hooks]],
2677+
report = [[Erik Cassel, 2012/06/05]],
2678+
since = [[5.2.0]],
2679+
example = [[
2680+
Set, in C, a line hook that simply yields,
2681+
and then call any Lua function.
2682+
You get an infinite loop of yields.
2683+
]],
2684+
patch = [[
2685+
]]
2686+
}
2687+
26512688

26522689
--[=[
26532690
Bug{

0 commit comments

Comments
 (0)