Skip to content

fix(vm): preserve live registers across metamethod calls - #150

Open
efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/lua-concat-meta
Open

efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/lua-concat-meta

Conversation

@efegokdemir

Copy link
Copy Markdown

An __index call during table construction can overwrite a live Lua register when the frame's temporary stack top is below its reserved slots. In issue #50's example, the second value becomes ASDASD b instead of b ASD b. Reserve the frame's stack slots for the tag method call, restore the temporary top afterwards, and cover the case with a regression test. go test -vet=off -race ./... passes; the default vet step is blocked by existing Go 1.27 diagnostics in doc_test.go.

Fixes #50.

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 this pull request may close these issues.

Bug: Tabled concatenated values read from metatable have wrong values

1 participant