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 @@ -3840,22 +3840,21 @@ dictreviter_iternext(dictiterobject *di)
3840
3840
PyDictKeysObject * k = d -> ma_keys ;
3841
3841
PyObject * key , * value , * result ;
3842
3842
3843
+ if (i < 0 ) {
3844
+ goto fail ;
3845
+ }
3843
3846
if (d -> ma_values ) {
3844
- if (i < 0 ) {
3845
- goto fail ;
3846
- }
3847
3847
key = DK_ENTRIES (k )[i ].me_key ;
3848
3848
value = d -> ma_values [i ];
3849
3849
assert (value != NULL );
3850
3850
}
3851
3851
else {
3852
3852
PyDictKeyEntry * entry_ptr = & DK_ENTRIES (k )[i ];
3853
- while (i >= 0 && entry_ptr -> me_value == NULL ) {
3853
+ while (entry_ptr -> me_value == NULL ) {
3854
+ if (-- i < 0 ) {
3855
+ goto fail ;
3856
+ }
3854
3857
entry_ptr -- ;
3855
- i -- ;
3856
- }
3857
- if (i < 0 ) {
3858
- goto fail ;
3859
3858
}
3860
3859
key = entry_ptr -> me_key ;
3861
3860
value = entry_ptr -> me_value ;
You can’t perform that action at this time.
0 commit comments