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

Panic on attempt to index a string value #524

Open
ligurio opened this issue Feb 17, 2025 · 0 comments
Open

Panic on attempt to index a string value #524

ligurio opened this issue Feb 17, 2025 · 0 comments

Comments

@ligurio
Copy link

ligurio commented Feb 17, 2025

Please answer the following before submitting your issue:

  • What version of GopherLua are you using? : ccacf66
  • What version of Go are you using? : 1.23.6
  • What operating system and processor architecture are you using? : Ubuntu 24.04 amd64
  • What did you do? : See below
  • What did you expect to see? : See below
  • What did you see instead? : See below

The Lua source code below

debug.setmetatable('string', {})
do ('Lua').key = 1 end;

triggers a panic in GopherLua:

$ /home/sergeyb/sources/go/bin/glua -e "
debug.setmetatable('string', {})
do ('Lua').key = 1 end;
"
runtime error: invalid memory address or nil pointer dereference
stack traceback:
        <string>:3: in main chunk
        [G]: ?

The same snippet executed by Lua 5.1 reports an error "attempt to index a string value":

$ lua5.1 -e "
debug.setmetatable('string', {})
do ('Lua').key = 1 end;
"
lua5.1: (command line):3: attempt to index a string value
stack traceback:
        (command line):3: in main chunk
        [C]: ?
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

No branches or pull requests

1 participant