GH-93143: Don't turn LOAD_FAST into LOAD_FAST_CHECK#99075
Conversation
|
I can look closer this evening, but mutating co_code is not ideal, so I think this is probably a good idea. |
Sorry, something went wrong.
|
There are two cases when we need to set locals to
In the first case we can set the local to However when jumping, trying to decide which locals need to be set to |
Sorry, something went wrong.
|
I've updated the code to skip scanning the bytecode for |
Sorry, something went wrong.
markshannon
left a comment
There was a problem hiding this comment.
👍
This feels safer and more robust than what we have now.
Sorry, something went wrong.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
The compiler's dataflow analysis for fast locals can be invalidated by jumps or deletions while tracing. When this happens, rather than changing
co_code(which users assume to be constant) to use the less-efficientLOAD_FAST_CHECKeverywhere, just display aRuntimeWarningand set any problematic locals toNoneinstead.