[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lua 5.3.2 introduced a bug related to coroutines
- From: Nagaev Boris <bnagaev@...>
- Date: Fri, 18 Mar 2016 02:07:11 +0300
$ cat bug.lua
local function yieldFirst(it)
return coroutine.wrap(function()
coroutine.yield(it())
end)
end
local text = "1 2 3"
local it = text:gmatch("(%d+)")
local head = yieldFirst(it)
local one = head()
print(one)
assert(one == '1')
$ ./lua-5.3.1/src/lua bug.lua
1
$ ./lua-5.3.2/src/lua bug.lua
function: 0x243f820
./lua-5.3.2/src/lua: bug.lua:12: assertion failed!
stack traceback:
[C]: in function 'assert'
bug.lua:12: in main chunk
[C]: in ?
--
Best regards,
Boris Nagaev