Add blku_defer to the context block union and use it in pp_goto - #24825
Open
richardleach wants to merge 2 commits into
Open
richardleach wants to merge 2 commits into
richardleach wants to merge 2 commits into
Conversation
This enables `goto` within a `defer {}` block when the block is not the
final item within its enclosing scope.
This is intended to fix GH Perl#19240, where this worked:
sub foo {
defer {
goto ham;
ham:
print "ham\n";
}
}
foo();
But this did not:
sub foo {
defer {
goto ham;
ham:
print "ham\n";
}
print "uh oh\n";
}
foo();
richardleach
force-pushed
the
goto_within_defer_19240
branch
from
September 15, 2026 22:08
f4a4300 to
cd982ca
Compare
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.
This enables
gotowithin adefer {}block when the block is not the final item within its enclosing scope.This is intended to fix: #19240 - where this worked:
But this did not:
Note: I'm not particularly familiar with how
pp_gotowalks the optree, so this could do with some good scrutiny.