Skip to content

Commit 38cd1d3

Browse files
fix _BINARY_OP_SUBSCR_DICT_KNOWN_HASH
1 parent c953a69 commit 38cd1d3

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

Python/bytecodes.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,14 +1249,9 @@ dummy_func(
12491249
PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
12501250
PyObject *dict = PyStackRef_AsPyObjectBorrow(dict_st);
12511251

1252-
assert(PyAnyDict_CheckExact(dict));
12531252
STAT_INC(BINARY_OP, hit);
1254-
PyObject *res_o;
1255-
int rc = _PyDict_GetItemRef_KnownHash((PyDictObject *)dict, sub, (Py_hash_t)hash, &res_o);
1256-
if (rc == 0) {
1257-
_PyErr_SetKeyError(sub);
1258-
}
1259-
if (rc <= 0) {
1253+
PyObject *res_o = _PyDict_SubscriptKnownHash(dict, sub, (Py_hash_t)hash);
1254+
if (res_o == NULL) {
12601255
ERROR_NO_POP();
12611256
}
12621257
res = PyStackRef_FromPyObjectSteal(res_o);

Python/executor_cases.c.h

Lines changed: 2 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)