diff options
author | Mark Shannon <mark@hotpy.org> | 2024-03-08 09:47:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 09:47:41 (GMT) |
commit | 0003285c8d78f0b463f2acc164655456fcfc3206 (patch) | |
tree | 8cb52887f94c39d3099c312188220592242a0e54 /Python/executor_cases.c.h | |
parent | 0b647141d587065c5b82bd658485adca8823a943 (diff) | |
download | cpython-0003285c8d78f0b463f2acc164655456fcfc3206.zip cpython-0003285c8d78f0b463f2acc164655456fcfc3206.tar.gz cpython-0003285c8d78f0b463f2acc164655456fcfc3206.tar.bz2 |
GH-113710: Fix optimization of globals using `_CHECK_FUNCTION` (GH-116460)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r-- | Python/executor_cases.c.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 26ac159..ccd8fb3 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -3829,8 +3829,9 @@ } case _CHECK_FUNCTION: { - PyObject *func = (PyObject *)CURRENT_OPERAND(); - if (frame->f_funcobj != func) goto deoptimize; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + assert(PyFunction_Check(frame->f_funcobj)); + if (((PyFunctionObject *)frame->f_funcobj)->func_version != func_version) goto deoptimize; break; } |