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: guard against pop in iter for range #3188

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Dec 10, 2022

What I did

Fix #3172.

How I did it

Pass context to pop_dyn_array and check constancy.

How to verify it

See tests

Commit message

fix: guard against `pop` in iter `for` range

Description for the changelog

Guard against pop in iter for range

Cute Animal Picture

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

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2022

Codecov Report

Merging #3188 (b2534be) into master (df26482) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3188      +/-   ##
==========================================
+ Coverage   88.38%   88.40%   +0.02%     
==========================================
  Files          88       88              
  Lines       11044    11048       +4     
  Branches     2337     2338       +1     
==========================================
+ Hits         9761     9767       +6     
+ Misses        826      825       -1     
+ Partials      457      456       -1     
Impacted Files Coverage Δ
vyper/semantics/analysis/local.py 91.31% <100.00%> (+0.10%) ⬆️
vyper/builtins/functions.py 90.85% <0.00%> (+0.16%) ⬆️

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

@tserg tserg marked this pull request as ready for review December 10, 2022 04:56
@@ -670,6 +671,12 @@ def parse_Call(self):
darray = Expr(self.expr.func.value, self.context).ir_node
assert len(self.expr.args) == 0
assert isinstance(darray.typ, DArrayType)

if self.context.is_constant():
Copy link
Member

Choose a reason for hiding this comment

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

i don't think this is the right place to do this

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.

i think this should actually be moved to the semantic pass.

@tserg tserg requested a review from charles-cooper December 11, 2022 03:23
@charles-cooper charles-cooper added this to the v0.3.8 milestone May 14, 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.

State can be modified in a range expression using pop
4 participants