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

Skip to content

Commit 9c5b521

Browse files
committed
Partly revert ad3824a90261 and add comment about reference ownership
2 parents 7ae251a + 1526582 commit 9c5b521

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Python/symtable.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
3333
if (ste == NULL)
3434
goto fail;
3535
ste->ste_table = st;
36-
ste->ste_id = k;
36+
ste->ste_id = k; /* ste owns reference to k */
3737

3838
ste->ste_name = name;
3939
Py_INCREF(name);
@@ -79,7 +79,6 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
7979

8080
return ste;
8181
fail:
82-
Py_XDECREF(k);
8382
Py_XDECREF(ste);
8483
return NULL;
8584
}

0 commit comments

Comments
 (0)