Repository navigation
compiler: check upvalue overflow and locate register errors - #556
Open
kimjooyoon wants to merge 2 commits into
Open
kimjooyoon wants to merge 2 commits into
kimjooyoon wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #554.
Fixes #555.
Two compiler limit failures currently hide the useful diagnosis: a 256-upvalue count wraps and is accepted, while local/register overflow errors point at the enclosing function's start (line 0 for a main chunk).
This change:
uint8, preserving the existing 255-capture capacity.Multiline declarations use their starting line; the AST does not retain individual name positions. The two issue fixes are separate commits in this PR.
Validation:
75f497656b1c6864139dd2a7d88cf96d09550814reproduces two cases where overflowing upvalue counts incorrectly compile and nine incorrect source-location cases. Five accepted-input controls remain valid.make buildpassed; generated files remain unchanged.go test -p=2 -json -count=1 -timeout=90s ./...passed on Go 1.25.0 and 1.27.3, macOS/arm64, against the combined head.AI assistance: OpenAI Codex (GPT-6) prepared the patches and tests; separate Codex agents reviewed them.