Skip to content

Properly fix Jump out of too many nested blocks error #21

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

Closed
wants to merge 4 commits into from

Conversation

insignification
Copy link

@insignification insignification commented Dec 11, 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)

(I've recreated this PR since the previous PR used the master branch of my fork)

insignification and others added 2 commits December 10, 2019 23:48
(overrides previous fix, as merging them would be too complex and
unneeded)
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

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

Copy link
Owner

@snoack snoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is brilliant! Thanks for the PR, I am just requesting a few minor changes, if you don't mind.

Also I noticed you added some trailing whitespaces, mind removing those as well?

As for Python 2.6, it's a bummer that it's no longer supported by Travis CI. Neither could I get it to build locally (as it depends on an ancient version of OpenSSL). 😞 So I removed it in 7164121. The tests should pass again after rebasing.

@insignification
Copy link
Author

insignification commented Dec 13, 2019

Thanks for the reply & the review!

a) About python 2.6, that's indeed a shame as I've added some more special cases for it in the other pull requests (I've used a windows binary of 2.6 for testing).

b) About merging, if you don't mind - I'll wait for you to review my other two pull requests and if you like them all - I'll edit just the last one according to all of your comments (as it's based on the first two). Then it'll get merged, and the others'll get closed. (Should be less work for both of us this way)

@snoack
Copy link
Owner

snoack commented Dec 13, 2019

b) About merging, if you don't mind - I'll wait for you to review my other two pull requests and if you like them all - I'll edit just the last one according to all of your comments (as it's based on the first two). Then it'll get merged, and the others'll get closed. (Should be less work for both of us this way)

I'm not sure if I understand correctly, but as I said on the other PR, reviewing the changes in bulk is difficult. So I rather review and land them separately. Also I'd like to squash all commits related to the same feature when landing it rather than having a series of commits with incomplete/partial changes.

I'm sorry if this causes you any inconvenience. I very much appreciate your effort!

@insignification
Copy link
Author

Okay, I'll update this pull request shortly, then split up the second pull request into two.

condut added 2 commits December 14, 2019 01:27
(This was originally in the second PR, but since you want to take this
one first, I think it's a good commit to add here, since it's relevant
to this change and would make diffing against future PRs easier)
@insignification
Copy link
Author

insignification commented Dec 13, 2019

I've added several new commits which:
a) Address all your requests/comments
b) Move back some refactoring (to my changes in this PR, so it should be part of it) that I originally only put in the second PR as I wasn't sure what the future of this PR would be.

Let me know if any other changes are requested in the refactored code.

@snoack
Copy link
Owner

snoack commented Dec 14, 2019

Awesome, thanks! I'd like to squash and merge the changes here. However, it seems you used different names / email addresses for different commits. Which one should the squashed commit be attributed to?

@insignification
Copy link
Author

insignification commented Dec 14, 2019

(EDIT:) It doesn't matter either way, but you can use the 'condut' one since that's the one I kept using in all the other PRs.

@snoack
Copy link
Owner

snoack commented Dec 14, 2019

Merged with 399d059.

@snoack snoack closed this Dec 14, 2019
@insignification
Copy link
Author

Thanks!

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.

2 participants