Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9101055

Browse files
committed
unpack_sequence(): In finally clause, watch out for Py_DECREF
evaluating its arguments twice.
1 parent 09f9547 commit 9101055

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,8 +2076,8 @@ unpack_sequence(v, argcnt, sp)
20762076
"unpack sequence of wrong size");
20772077
/* fall through */
20782078
finally:
2079-
for (; i > 0; i--)
2080-
Py_DECREF(*sp++);
2079+
for (; i > 0; i--, sp++)
2080+
Py_DECREF(*sp);
20812081

20822082
return 0;
20832083
}

0 commit comments

Comments
 (0)