-
Notifications
You must be signed in to change notification settings - Fork 8
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
reopen: stack size computation is broken #3 #5
Comments
xref #3 |
I believe current version for Python 2 ( |
An important modification I made to the stack calculation is that we take the maximum stack usage if two branches with different stack usage combine & then return without looping |
I don't quite understand your improvement. The original version doesn't contain looping, it calculates stack depth for every possible scope (including loop scopes). Besides, after your changes stack depth calculation returns 0, at least sometimes (confirmed by @pwaller with Python 2, and by me with Python 3.4 for other test case). |
I mean the bytecode looping. ie
Should be allowed to compile |
What do you mean by "bytecode looping"? There is no loops in your code only two possible execution branches with one label. To determine stack depth correctly one has to visit both execution branches and return maximum stack effect. Also the code that you mention isn't "regular" (we can reach |
CPython won't but a programmer may. Byteplay also supports creating constants that are mutable Yes, there are no loops. The stack depth calculation should only throw an error if one creates a loop which makes the possible stack depth unbounded |
I encountered the 'closed' issue reported by @pwaller with Python 3.4. Stack size computation is broken (method '_compute_stacksize') and returns zero for every block of code I tried. As I mentioned in comment of original issue I tried to fix it (peterazmanov/byteplay). My changes stopped crashes, but the code requires further testing.
The text was updated successfully, but these errors were encountered: