Skip to content

fix(vm): preserve Lua modulo semantics for negative operands - #149

Open
efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/fix-lua-negative-modulo
Open

efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/fix-lua-negative-modulo

Conversation

@efegokdemir

Copy link
Copy Markdown

Lua’s numeric modulo fast paths used Go’s truncating math.Mod, while the fallback uses Lua 5.2’s floor-based rule. Both VM paths now use the shared arithmetic helper. Regression coverage checks the reported numeric-local cases, literals, string coercion and math.fmod. go test -race -vet=off ./... and go build ./... passed. The default go test vet step flags the existing external ExampleFunction in doc_test.go, so vet was disabled for test runs. Fixes #148.

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.

Numeric modulo fast path disagrees with Lua 5.2 and the library fallback for negative operands

1 participant