Partly revert ad3824a90261 and add comment about reference ownership
This commit is contained in:
parent
79b97ee2ab
commit
1526582df6
|
@ -37,7 +37,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
|
||||||
if (ste == NULL)
|
if (ste == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
ste->ste_table = st;
|
ste->ste_table = st;
|
||||||
ste->ste_id = k;
|
ste->ste_id = k; /* ste owns reference to k */
|
||||||
|
|
||||||
ste->ste_name = name;
|
ste->ste_name = name;
|
||||||
Py_INCREF(name);
|
Py_INCREF(name);
|
||||||
|
@ -83,7 +83,6 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
|
||||||
|
|
||||||
return ste;
|
return ste;
|
||||||
fail:
|
fail:
|
||||||
Py_XDECREF(k);
|
|
||||||
Py_XDECREF(ste);
|
Py_XDECREF(ste);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue