summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-03-08 09:47:41 (GMT)
committerGitHub <noreply@github.com>2024-03-08 09:47:41 (GMT)
commit0003285c8d78f0b463f2acc164655456fcfc3206 (patch)
tree8cb52887f94c39d3099c312188220592242a0e54 /Python/bytecodes.c
parent0b647141d587065c5b82bd658485adca8823a943 (diff)
downloadcpython-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/bytecodes.c')
-rw-r--r--Python/bytecodes.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 0397d96..bf9d2a3 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -4096,8 +4096,9 @@ dummy_func(
null = NULL;
}
- tier2 op(_CHECK_FUNCTION, (func/4 -- )) {
- DEOPT_IF(frame->f_funcobj != func);
+ tier2 op(_CHECK_FUNCTION, (func_version/2 -- )) {
+ assert(PyFunction_Check(frame->f_funcobj));
+ DEOPT_IF(((PyFunctionObject *)frame->f_funcobj)->func_version != func_version);
}
/* Internal -- for testing executors */