-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Error handling for some instructions is incorrect #99298
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
Comments
Interesting. There are now some instrs that have |
The (Note also that error handling for eval breakers is unaffected by this issue, since we can just pretend that any errors raised by eval breaker checks happened as part of the next instruction... basically, we act as if eval breakers are checked just before the next instruction, rather than just after the current one.) |
So yeah, we probably need a way to spell this as part of the DSL. But it might be able to wait for now... I think only |
Another option could be to make |
I'd rather not add more opcodes. These can use the legacy format for now; eventually we'll add some silly little flag to the instruction definition format. |
In several places, we have
goto error;
branches in bytecode instructions that occur after modifying thenext_instr
pointer. This is incorrect, since the error branch will behave as if the error occurred in the new location (most often an adjacent instruction). The result could be as benign as an incorrect location in a traceback, or as problematic as incorrect control flow in or near atry
/except
block.I tried for a bit to make the compiler emit code that did the wrong thing here, and I wasn't able to. So this is mostly a theoretical concern (but still worth fixing).
The text was updated successfully, but these errors were encountered: