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
Bounds checking in range() #1738
Bounds checking in range() #1738
Conversation
Add link to Gitcoin Grant for Github Sponsors Button
this needs to be rebased off master (and the stray commit removed) |
vyper/parser/stmt.py
Outdated
if not SizeLimits.in_bounds(typ, val): | ||
raise InvalidLiteralException('Invalid range value supplied', self.stmt) | ||
|
||
def _get_outtype(self, arg0_expr: LLLnode, arg1_expr: LLLnode) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code will be a lot clearer if this is called _get_range_type
.
Co-Authored-By: Charles Cooper <cooper.charles.m@gmail.com>
@fubuloubu @charles-cooper made changes as suggested; I think it ready to be merged now? |
This pull request introduces 1 alert when merging eb9e5e2 into 391b251 - view on LGTM.com new alerts:
|
@@ -570,7 +570,8 @@ def parse_for(self): | |||
if num_of_args == 1: | |||
arg0_expr = self._get_range_const_value_expr(arg0) | |||
arg0_val = arg0_expr.value | |||
out_type_str = arg0_expr.typ.typ | |||
out_type = arg0_expr.typ | |||
start = LLLnode.from_list(0, typ=out_type, pos=getpos(self.stmt)) | |||
start = LLLnode.from_list(0, typ=out_type_str, pos=getpos(self.stmt)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This... doesn't seem right
Can we also rename |
Should be fixed by type checking work |
What I did
How I did it
How to verify it
Description for the changelog
Cute Animal Picture