-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
The optimizer is replacing _GUARD_CODE_VERSION with a watcher, which would be fine if the code object were known.
However, the code object is just the one observed during tracing. The one observed during execution could be different, which is why the guard was added in the first place.
We should only remove the guard if the code version is known.
Correct optimizations would be:
- Only remove the first guard (and add the code watcher)
- If the function is known and its version is known, remove the guard.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error