Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No backlabels in a block with return #75

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Conversation

arnodel
Copy link
Owner

@arnodel arnodel commented Jan 19, 2022

Labels at the end of a statement are called "back-labels", as a special case these can be jumped to even if there is a local variable declaration in the block between the goto statement and the label declaration. E.g.

do
    goto L
    local a = 2
    ::L::
end

There is a bug in label declaration processing which means this is allowed erroneously if the block end in a return statement, i.e.

do
    goto L
    local a = 2
    ::L::  return a
end

This PR disallows the latter.

@arnodel arnodel added the bug label Jan 19, 2022
@arnodel arnodel merged commit afdd857 into master Jan 20, 2022
@arnodel arnodel deleted the fix-return-backlabel branch January 20, 2022 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants