-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mypyc] Fixing index variable in for-loop with builtins.enumerate. (#…
…18202) Fixes [mypyc/mypyc#1046](mypyc/mypyc#1046) This change fixes two problems: 1. The index variable was getting instantiated even while enumerating an empty iterable. 2. After exiting the for-loop, the value of the index variable is off by 1 (see issue linked above). This change fixes both problems by assigning the temporary register to the index variable at the beginning of the for-loop body. Before this change, this assignment was happening before the for-loop and at the end of the for-loop body.
- Loading branch information
1 parent
2842e8f
commit d39eacc
Showing
3 changed files
with
32 additions
and
11 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