New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show_caches option affects code positions reported by dis.get_instructions(...) #91389
Comments
The Instructions reported by dis.get_instructions(...) and dis.Bytecode(...) have different positions depending on the value of their show_caches argument. test2.py reproduces the problem. |
Nice catch. The fix should be pretty simple: just move this line... Line 425 in c1d93b6
...up to the top of the for loop. Are you interested in working on this? |
I moved the line. |
The problem was fixed with e590379. |
Was it? I haven't run it yet, but that patch doesn't look like it fixed the issue (there's still an early continue at the top of the loop). |
yes, I bisected it down to this commit. |
wait, maybe cache_counter gets never >0 in my tests ... the bug might be still there. |
I have verified that the cache_counter gets >0 in my tests. I think the CACHE instructions have no corresponding positions in co_positions. It always continues the loop if the cache_conter is > 0. I think the current implementation is has no bug. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: