gh-146058: Fix _GUARD_CODE_VERSION_* (GH-146060)

This commit is contained in:
Ken Jin 2026-03-18 01:19:44 +08:00 committed by GitHub
parent ff287a72de
commit 966fc81531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 1557 additions and 1154 deletions

View file

@ -1775,19 +1775,6 @@ dummy_func(void) {
// do not need an IP guard.
}
op(_GUARD_CODE_VERSION, (version/2 -- )) {
PyCodeObject *co = get_current_code_object(ctx);
if (co->co_version == version) {
_Py_BloomFilter_Add(dependencies, co);
// TODO gh-144651:
// If we've previously guarded on this code version in a trace, we
// can avoid guarding it again.
}
else {
ctx->done = true;
}
}
op(_GUARD_IP_YIELD_VALUE, (ip/4 --)) {
(void)ip;
if (ctx->frame->caller) {