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 failure with nonreentrant keys #2514

Merged
merged 2 commits into from
Oct 26, 2021

Conversation

charles-cooper
Copy link
Member

codegen now fails (stops compiling) as of eae0eaf. This is because
the storage layout is generated correctly but the type metadata is not
updated after the first function that references a nonreentrancy key.

This commit also adds a codegen test to check codegen of repeated
nonreentrancy keys.

What I did

Fix bug introduced in #2439

How I did it

How to verify it

Check the following contract fails to compile on master but compiles on this branch

@external
@nonreentrant("foo")
def foo():
    pass
 
@external
@nonreentrant("foo")
def bar():
    pass

Description for the changelog

Cute Animal Picture

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

codegen now fails (stops compiling) as of eae0eaf. This is because
the storage layout is generated correctly but the type metadata is not
updated after the first function that references a nonreentrancy key.

This commit also adds a codegen test to check codegen of repeated
nonreentrancy keys.
@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2021

Codecov Report

Merging #2514 (efe4666) into master (4b9d860) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2514      +/-   ##
==========================================
- Coverage   84.62%   84.61%   -0.02%     
==========================================
  Files          94       94              
  Lines        9303     9328      +25     
  Branches     2099     2103       +4     
==========================================
+ Hits         7873     7893      +20     
- Misses        943      946       +3     
- Partials      487      489       +2     
Impacted Files Coverage Δ
vyper/semantics/validation/data_positions.py 93.75% <100.00%> (+0.64%) ⬆️
vyper/builtin_functions/functions.py 88.68% <0.00%> (-0.29%) ⬇️
vyper/old_codegen/parser_utils.py 82.78% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b9d860...efe4666. Read the comment docs.

it works on either nonreentrant function calling the other
@charles-cooper charles-cooper merged commit 25aa67e into vyperlang:master Oct 26, 2021
@charles-cooper charles-cooper deleted the fix/storage_slots branch October 26, 2021 21:39
@charles-cooper charles-cooper restored the fix/storage_slots branch August 1, 2023 00:30
@charles-cooper charles-cooper deleted the fix/storage_slots branch August 1, 2023 00:31
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