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

Don't generate code for NODE_NEGATE if the result isn't used #3324

Merged
merged 1 commit into from Dec 10, 2016

Conversation

Projects
None yet
2 participants
@bouk
Contributor

bouk commented Dec 6, 2016

As reported by https://hackerone.com/haquaman

The current code for NODE_NEGATE can cause a register misalignment, as it pushes values onto the stack even when its return value isn't used. This PR fixes it with a short circuit if the result isn't used (which leads to the code being optimized away entirely if the tree is NODE_FLOAT or NODE_INT)

@matz matz merged commit d56a19c into mruby:master Dec 10, 2016

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

matz added a commit that referenced this pull request Dec 10, 2016

Merge pull request #3324 from bouk/mruby/bouk-negate
Don't generate code for NODE_NEGATE if the result isn't used
Reported by https://hackerone.com/haquaman

matz added a commit that referenced this pull request Dec 17, 2016

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