File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -3830,22 +3830,21 @@ dictreviter_iternext(dictiterobject *di)
3830
3830
PyDictKeysObject * k = d -> ma_keys ;
3831
3831
PyObject * key , * value , * result ;
3832
3832
3833
+ if (i < 0 ) {
3834
+ goto fail ;
3835
+ }
3833
3836
if (d -> ma_values ) {
3834
- if (i < 0 ) {
3835
- goto fail ;
3836
- }
3837
3837
key = DK_ENTRIES (k )[i ].me_key ;
3838
3838
value = d -> ma_values [i ];
3839
3839
assert (value != NULL );
3840
3840
}
3841
3841
else {
3842
3842
PyDictKeyEntry * entry_ptr = & DK_ENTRIES (k )[i ];
3843
- while (i >= 0 && entry_ptr -> me_value == NULL ) {
3843
+ while (entry_ptr -> me_value == NULL ) {
3844
+ if (-- i < 0 ) {
3845
+ goto fail ;
3846
+ }
3844
3847
entry_ptr -- ;
3845
- i -- ;
3846
- }
3847
- if (i < 0 ) {
3848
- goto fail ;
3849
3848
}
3850
3849
key = entry_ptr -> me_key ;
3851
3850
value = entry_ptr -> me_value ;
You can’t perform that action at this time.
0 commit comments