diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2022-09-06 04:11:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 12:11:38 +0100 |
commit | cd0ff9bd14d6a60e841d10f8415827db556ae622 (patch) | |
tree | 44b5add368d946a354d4c79b90c3026e5a8c553f /Python | |
parent | f177f6f29b069f522a0b3ba44eaae19852b6d2b0 (diff) | |
download | cpython-git-cd0ff9bd14d6a60e841d10f8415827db556ae622.tar.gz |
GH-93911: Fix `LOAD_ATTR_PROPERTY` caches (GH-96519)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/specialize.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/specialize.c b/Python/specialize.c index e8c3f468fe..299adf3452 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -775,8 +775,10 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_PROPERTY_NOT_PY_FUNCTION); goto fail; } - uint32_t version = function_check_args(fget, 1, LOAD_ATTR) && - function_get_version(fget, LOAD_ATTR); + if (!function_check_args(fget, 1, LOAD_ATTR)) { + goto fail; + } + uint32_t version = function_get_version(fget, LOAD_ATTR); if (version == 0) { goto fail; } @@ -831,9 +833,7 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) assert(type->tp_getattro == _Py_slot_tp_getattro); assert(Py_IS_TYPE(descr, &PyFunction_Type)); _PyLoadMethodCache *lm_cache = (_PyLoadMethodCache *)(instr + 1); - uint32_t func_version = function_check_args(descr, 2, LOAD_ATTR) && - function_get_version(descr, LOAD_ATTR); - if (func_version == 0) { + if (!function_check_args(descr, 2, LOAD_ATTR)) { goto fail; } /* borrowed */ |