-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require labels in functions to be unique
While one cannot have duplicate labels within a block, Lua 5.2 and 5.3 allowed duplicate labels within a function, jumping to the label in the closest block. Lua 5.4 removed this feature, requiring unique labels across a function. We apply the same change for Cobalt, as (IMO) label resolution rules are confusing. Note, this does *not* port the rest of Lua 5.4's goto code. Lua 5.4 now searches all active labels when jumping (not just those in the current block). This simplifies the code, but also generates slightly different bytecode (as it can't eliminate closes in as many cases). To aid testing, we leave the rest of the code as-is.
- Loading branch information
Showing
3 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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