Skip to content

Conversation

@insignification
Copy link

@insignification insignification commented Dec 10, 2019

This fixes issue #19

The fix is to - if there isn't enough space to write the new bytecode in-place - write it at the end of the bytecode array and add jumps to/from there.

It replaces the previous attempted fix for this issue, as including both would be too complex and
is unneeded.

The tests have been updated (previously they were checking that the issue exists), and a new even more extreme test has been added.
Result observed to work correctly in "real" code. (No, not production code :P)

Tested on pypy3.6
Please test on other python versions. (I can't easily install them here)

(overrides previous fix, as merging them would be too complex and
unneeded)
@insignification
Copy link
Author

insignification commented Dec 10, 2019

Failing test fails due to Python 2.6 no longer existing on test machine, not related to my changes. (See Thread)
Rest of the tests pass.

I was not able to get it to happen for pretty huge functions (much much
larger than the ones in the test), though, so there's a good chance it's
unreachable.
@insignification
Copy link
Author

insignification commented Dec 11, 2019

By the way, I may plan to make other pull requests with various fixes and additions to python-goto in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant