Skip to content

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

Merged
charles-cooper merged 5 commits intovyperlang:masterfrom
tserg:fix/incorrect_overflow
Dec 9, 2024
Merged

fix[ux]: fix false positive for overflow in type checker#4385
charles-cooper merged 5 commits intovyperlang:masterfrom
tserg:fix/incorrect_overflow

Conversation

@tserg
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
@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