fix: resolve goto labels by lexical scope - #1389
Merged
Merged
Conversation
Preserve the in-progress compiler changes before continued debugging. Generated with Codex (https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
Bind static goto labels to their containing blocks, preserve first repeated labels, validate eval destinations by PC range, and restore the package at a goto label. Add focused regression coverage and document core-test validation. Generated with Codex (https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
Resolve duplicate labels by lexical target, reject invalid entries into foreach and expression blocks, and retain optimized-away label failures. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
Keep the generated-constructor origin through both goto label collectors so internal do-block jumps in class field defaults remain valid. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
fglock
marked this pull request as ready for review
September 15, 2026 20:05
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.
Summary
gotolabels by lexical block, including forward/backward references and repeated labelsValidation
make— passedmake check-links— passedgoto_scoped_labels.t— passed on JVM and interpretergoto_label_package.t— passed on JVM and interpreterperl5_t/t/op/goto.t— both modes exit 0; all 80 assertions present in the imported file execute, with only its two existing TODO non-passesThe imported
op/goto.tstill declares 87 tests but contains/emits 80 assertions, so it prints a plan-mismatch diagnostic despite exiting 0. This PR preserves that imported test unchanged and documents the discrepancy in the handoff.