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[codegen]: relax the filter for augassign oob check #4497

Merged
merged 12 commits into from
Feb 27, 2025

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Feb 26, 2025

What I did

relax the filter in #4487

How I did it

How to verify it

Commit message

this commit relaxes the filter introduced in dd5a3d9e0f1e8685. the
filter was valid, but blocked too many user programs. this commit
updates the filter so that the external call check is only applied if
there is a state variable on the lhs. it also updates the external call
check to only consider state-modifying calls, since staticcalls cannot
modify the lhs.

Description for the changelog

Cute Animal Picture

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

@charles-cooper charles-cooper marked this pull request as ready for review February 26, 2025 10:24
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.07%. Comparing base (1339177) to head (be05638).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4497   +/-   ##
=======================================
  Coverage   92.06%   92.07%           
=======================================
  Files         120      120           
  Lines       17335    17343    +8     
  Branches     2935     2937    +2     
=======================================
+ Hits        15960    15968    +8     
  Misses        957      957           
  Partials      418      418           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@charles-cooper charles-cooper enabled auto-merge (squash) February 27, 2025 11:02
@charles-cooper charles-cooper merged commit b117756 into vyperlang:master Feb 27, 2025
159 checks passed
@@ -293,7 +293,9 @@ def parse_AugAssign(self):
if var.typ._is_prim_word:
continue
# oob - GHSA-4w26-8p97-f4jp
if var in right.variable_writes or right.contains_risky_call:
if var in right.variable_writes or (
var.is_state_variable() and right.contains_writeable_call
Copy link
Member Author

Choose a reason for hiding this comment

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

note: immutables count as state variables

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