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

fix[ux]: fix false positive for overflow in type checker #4385

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Dec 3, 2024

What I did

Fix #4383

How I did it

Catch OverflowException when finding possible types for BinOp node.

How to verify it

See test.

Commit message

this commit fixes a false positive for integer overflow in
the typechecker involving nested pow operations by filtering
`OverflowException` in `_validate_op`. the previous code assumed that
`validate_numeric_op` could throw anything besides `InvalidOperation`,
but for the `Pow` binop, it can throw `OverflowException`.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

Copy link
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@charles-cooper charles-cooper changed the title fix[ux]: exclude possible type if overflow fix[ux]: fix false positive for overflow in type checking Dec 7, 2024
@charles-cooper charles-cooper requested review from cyberthirst and removed request for cyberthirst December 7, 2024 22:58
@charles-cooper charles-cooper changed the title fix[ux]: fix false positive for overflow in type checking fix[ux]: fix false positive for overflow in type checker Dec 9, 2024
@charles-cooper charles-cooper enabled auto-merge (squash) December 9, 2024 22:54
@charles-cooper charles-cooper merged commit 12ab491 into vyperlang:master Dec 9, 2024
156 checks passed
@tserg tserg deleted the fix/incorrect_overflow branch December 10, 2024 02:50
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.

incorrectly reported overflow exception
3 participants