Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
constant folding shouldn't change return value of while [perl #73618]
If the expression in while (EXPR) is a false constant, just return that constant expression rather than OP_NULL during optimization. Doesn't handle until loops yet, because "until (1)" is converted to "while (!1)" by the parser, and so "!1" is already constant-folded to '' by the time the while loop optree is constructed. Not sure what to do about that.
- Loading branch information
Showing
2 changed files
with
63 additions
and
3 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