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

chore: fix fuzzer test case #3383

Merged
merged 1 commit into from
May 5, 2023

Conversation

charles-cooper
Copy link
Member

for cases where a << b is an int256 between max_value(int256) and max_value(uint256), the typechecker will fail with TypeMismatch instead of OverflowException. this fixes the test to catch the case. note that the code was correctly failing to compile, just the test was not catching both exception types.

(this test case was found in https://github.com/vyperlang/vyper/actions/runs/4886254516/jobs/8721370863?pr=3370):

E           vyper.exceptions.InvalidType: <unprintable InvalidType object>

vyper/semantics/analysis/utils.py:578: InvalidType
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_bitwise_shift_signed(
    get_contract=<function tests.base_conftest.get_contract.<locals>.get_contract>,
    a=16,
    b=251,
    op='<<',
)

What I did

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

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

for cases where `a << b` is an int256 between `max_value(int256)` and
`max_value(uint256)`, the typechecker will fail with TypeMismatch
instead of OverflowException. this fixes the test to catch the case.
note that the code was correctly failing to compile, just the test was
not catching both exception types.
@charles-cooper charles-cooper requested a review from fubuloubu May 5, 2023 00:57
@fubuloubu fubuloubu enabled auto-merge (squash) May 5, 2023 01:00
@codecov-commenter
Copy link

codecov-commenter commented May 5, 2023

Codecov Report

Merging #3383 (0f919ef) into master (7c3cf61) will decrease coverage by 0.19%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master    #3383      +/-   ##
==========================================
- Coverage   88.88%   88.69%   -0.19%     
==========================================
  Files          85       85              
  Lines       10706    10706              
  Branches     2233     2233              
==========================================
- Hits         9516     9496      -20     
- Misses        788      809      +21     
+ Partials      402      401       -1     

see 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@fubuloubu fubuloubu merged commit f914011 into vyperlang:master May 5, 2023
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.

3 participants