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
refactor: Avoid unsigned integer overflow in script/interpreter.cpp
#29543
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Needs rebase. But see also the discussion in #29541. I would prefer narrowing the suppression to as little as possible, but without touching the ancient code. |
Although unsigned integer overflow is not undefined behavior, it's preferable to eliminate the need for a UBSan suppression for it.
Rebased.
Anything in your mind without growing the diff up to 10+ lines?
I still believe that the suggested diff is reviewable. |
ACK 754ba68 This is consensus-critical code, so I've carefully verified that this change does not modify behavior:
|
Not really, though the above proof by @sipa is also 10+ lines :-) |
Alternative (for context): #24214 |
Oh, I missed that. |
I find #24214 more readable, because it doesn't use the double minus. |
ACK to the idea of removing overflows in the code, but I was little worried of the implications of this. After reading @sipa 's comment, it is definitely an ACK for me. Regarding the approach between this PR and #24214 , I am leaning towards this for the sole reason that 24214 is still closed, but i reviewed and also ACK that PR as well. |
Although unsigned integer overflow is not undefined behavior, it's preferable to eliminate the need for an UBSan suppression for it.
This is an alternative to #29541.