summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2023-11-03 14:02:07 (GMT)
committerGitHub <noreply@github.com>2023-11-03 14:02:07 (GMT)
commit1a95ad68b4156fbd04bd5c479f3ef9ca30f0a8f5 (patch)
treeb79a4f12f62e5ea60cc4c1b6f48e381ede42b344 /Python/bytecodes.c
parent4db71c3ca7ba6c290ebdf54452ff0ccca0a174af (diff)
downloadcpython-1a95ad68b4156fbd04bd5c479f3ef9ca30f0a8f5.zip
cpython-1a95ad68b4156fbd04bd5c479f3ef9ca30f0a8f5.tar.gz
cpython-1a95ad68b4156fbd04bd5c479f3ef9ca30f0a8f5.tar.bz2
[3.12] gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (GH-111655) (#111674)
(cherry picked from commit 3a1b09e6d070778d78d81084f88d37377d38ee9b) Co-authored-by: AN Long <aisk@users.noreply.github.com>
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index e20b9ff..b957d88 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -1425,7 +1425,6 @@ dummy_func(
Py_INCREF(value);
}
else if (_PyErr_Occurred(tstate)) {
- Py_DECREF(class_dict);
goto error;
}
}
@@ -1433,13 +1432,11 @@ dummy_func(
value = PyObject_GetItem(class_dict, name);
if (value == NULL) {
if (!_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
- Py_DECREF(class_dict);
goto error;
}
_PyErr_Clear(tstate);
}
}
- Py_DECREF(class_dict);
if (!value) {
PyObject *cell = GETLOCAL(oparg);
value = PyCell_GET(cell);
@@ -1449,6 +1446,7 @@ dummy_func(
}
Py_INCREF(value);
}
+ Py_DECREF(class_dict);
}
inst(LOAD_DEREF, ( -- value)) {