Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect behavior for string.gmatch #462

Open
zyedidia opened this issue Nov 7, 2023 · 0 comments · May be fixed by #466
Open

Incorrect behavior for string.gmatch #462

zyedidia opened this issue Nov 7, 2023 · 0 comments · May be fixed by #466

Comments

@zyedidia
Copy link

zyedidia commented Nov 7, 2023

Gopher Lua version: 9d7d921
Go version: 1.21.0

Ran the following file:

local x = string.gmatch("asdf", "a")
print(x())
$ lua5.1 test.lua
a
$ glua test.lua
test.lua:2: bad argument #1 to x (userdata expected, got nil)
stack traceback:
        [G]: in function 'x'
        test.lua:2: in main chunk
        [G]: ?

It seems like string.gmatch produces a closure that expects some internal userdata. Thanks for your help!

@waschik waschik linked a pull request Dec 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant