Skip to content
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

LibJS+AK: Fix integer overflow UB on (any Int32 - -2147483648) #24354

Merged
merged 1 commit into from
May 18, 2024

Conversation

awesomekling
Copy link
Member

It wasn't safe to use addition_would_overflow(a, -b) to check if subtraction (a - b) would overflow, since it doesn't cover this case.

I don't know why we didn't have subtraction_would_overflow(), so this patch adds it. :^)

It wasn't safe to use addition_would_overflow(a, -b) to check if
subtraction (a - b) would overflow, since it doesn't cover this case.

I don't know why we didn't have subtraction_would_overflow(), so this
patch adds it. :^)
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 18, 2024
@awesomekling awesomekling merged commit b2e6843 into SerenityOS:master May 18, 2024
11 checks passed
@awesomekling awesomekling deleted the js_sub_ub branch May 18, 2024 16:11
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label May 18, 2024
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.

None yet

1 participant