mirror of
https://github.com/python/cpython.git
synced 2026-01-01 13:03:56 +00:00
GH-134584: Remove redundant refcount for BINARY_OP_SUBSCR_STR_INT (#142844)
This commit is contained in:
parent
e79c39101a
commit
1391ee664c
9 changed files with 74 additions and 31 deletions
|
|
@ -941,9 +941,9 @@ dummy_func(
|
|||
}
|
||||
|
||||
macro(BINARY_OP_SUBSCR_STR_INT) =
|
||||
_GUARD_TOS_INT + _GUARD_NOS_UNICODE + unused/5 + _BINARY_OP_SUBSCR_STR_INT;
|
||||
_GUARD_TOS_INT + _GUARD_NOS_UNICODE + unused/5 + _BINARY_OP_SUBSCR_STR_INT + _POP_TOP_INT + POP_TOP;
|
||||
|
||||
op(_BINARY_OP_SUBSCR_STR_INT, (str_st, sub_st -- res)) {
|
||||
op(_BINARY_OP_SUBSCR_STR_INT, (str_st, sub_st -- res, s, i)) {
|
||||
PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
|
||||
PyObject *str = PyStackRef_AsPyObjectBorrow(str_st);
|
||||
|
||||
|
|
@ -958,9 +958,9 @@ dummy_func(
|
|||
assert(c < 128);
|
||||
STAT_INC(BINARY_OP, hit);
|
||||
PyObject *res_o = (PyObject*)&_Py_SINGLETON(strings).ascii[c];
|
||||
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
|
||||
DEAD(sub_st);
|
||||
PyStackRef_CLOSE(str_st);
|
||||
INPUTS_DEAD();
|
||||
s = str_st;
|
||||
i = sub_st;
|
||||
res = PyStackRef_FromPyObjectBorrow(res_o);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue