summaryrefslogtreecommitdiff
path: root/Python/specialize.c
diff options
context:
space:
mode:
authoradphrost <104581013+adphrost@users.noreply.github.com>2022-09-15 08:42:37 -0700
committerGitHub <noreply@github.com>2022-09-15 16:42:37 +0100
commita41ed975e863ae0ca435783596f14f8492d62f8d (patch)
treeb87ceae5a7c55e1131a7cdf02b0cda2b6ca41eaf /Python/specialize.c
parente37ac5fbb6de593521cf218aa05bc58a45c5a7c9 (diff)
downloadcpython-git-a41ed975e863ae0ca435783596f14f8492d62f8d.tar.gz
GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)
Co-authored-by: Andrew Frost <adfrost@fb.com> Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 93f1d289b3..b7c321e487 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -837,6 +837,11 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name)
if (!function_check_args(descr, 2, LOAD_ATTR)) {
goto fail;
}
+ uint32_t version = function_get_version(descr, LOAD_ATTR);
+ if (version == 0) {
+ goto fail;
+ }
+ write_u32(lm_cache->keys_version, version);
/* borrowed */
write_obj(lm_cache->descr, descr);
write_u32(lm_cache->type_version, type->tp_version_tag);