GH-113710: Fix optimization of globals using _CHECK_FUNCTION (GH-116460)

This commit is contained in:
Mark Shannon 2024-03-08 09:47:41 +00:00 committed by GitHub
parent 0b647141d5
commit 0003285c8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 10 deletions

View file

@ -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 */