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: range check for decimal values in evaluation of builtin functions #3283

Merged

Conversation

trocher
Copy link
Contributor

@trocher trocher commented Feb 16, 2023

What I did

Fix #3282

How I did it

  • Changed >= 2 ** 127 by > SizeLimits.MAX_AST_DECIMAL
  • Changed < -(2 ** 127) by < SizeLimits.MIN_AST_DECIMAL

How to verify it

See the modified tests that should have failed (depending on the generation of the input by the fuzzer) with the old code.

Commit message

fix: range check for decimal values in evaluation of builtin functions

Description for the changelog

Fix the range check for decimal values in evaluation of builtin functions

Cute Animal Picture

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

@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2023

Codecov Report

Merging #3283 (e6ee820) into master (187ab0e) will not change coverage.
The diff coverage is 0.00%.

📣 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    #3283   +/-   ##
=======================================
  Coverage   88.86%   88.86%           
=======================================
  Files          84       84           
  Lines       10599    10599           
  Branches     2214     2214           
=======================================
  Hits         9419     9419           
  Misses        770      770           
  Partials      410      410           
Impacted Files Coverage Δ
vyper/builtins/functions.py 90.43% <0.00%> (ø)

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

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.

looks good, with the caveat/note to self that this will all need to be updated once we generalize the decimal type

@charles-cooper charles-cooper merged commit b2f22da into vyperlang:master Feb 16, 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.

_MinMax and AsWeiValue perform too restrictive checks on Decimal inputs
3 participants