mirror of https://github.com/rusefi/lua.git
values holded in open upvalues of suspended threads may be
incorrectly collected
This commit is contained in:
parent
621ef9f767
commit
0e60572606
39
bugs
39
bugs
|
@ -428,6 +428,7 @@ patch = [[
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bug{
|
Bug{
|
||||||
what = [[`pc' address is invalidated when a coroutine is suspended]],
|
what = [[`pc' address is invalidated when a coroutine is suspended]],
|
||||||
example = [[
|
example = [[
|
||||||
|
@ -704,3 +705,41 @@ patch = [[
|
||||||
]]
|
]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Bug{
|
||||||
|
what = [[values holded in open upvalues of suspended threads may be
|
||||||
|
incorrectly collected]],
|
||||||
|
|
||||||
|
report = [[Spencer Schumann, 31/12/2004]],
|
||||||
|
|
||||||
|
example = [[
|
||||||
|
local thread_id = 0
|
||||||
|
local threads = {}
|
||||||
|
|
||||||
|
function fn(thread)
|
||||||
|
thread_id = thread_id + 1
|
||||||
|
threads[thread_id] = function()
|
||||||
|
thread = nil
|
||||||
|
end
|
||||||
|
coroutine.yield()
|
||||||
|
end
|
||||||
|
|
||||||
|
while true do
|
||||||
|
local thread = coroutine.create(fn)
|
||||||
|
coroutine.resume(thread, thread)
|
||||||
|
end
|
||||||
|
]],
|
||||||
|
|
||||||
|
patch = [[
|
||||||
|
* lgc.c:
|
||||||
|
221,224c221,222
|
||||||
|
< if (!u->marked) {
|
||||||
|
< markobject(st, &u->value);
|
||||||
|
< u->marked = 1;
|
||||||
|
< }
|
||||||
|
---
|
||||||
|
> markobject(st, u->v);
|
||||||
|
> u->marked = 1;
|
||||||
|
]],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue