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[venom]: alloca for default arguments #4155

Merged

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Jun 17, 2024

What I did

How I did it

How to verify it

Commit message

this commit fixes an `ir_node_to_venom` translation bug. when there is
a default argument to an external function, it can generate multiple
allocas, because the entry points allocate separate symbol tables, but
actually they should all correspond to the same alloca. for instance,
`external 1 foo(uint256)12345` and `external 1 foo()67890` both feed
into the same `external 1 foo()__common`, but the current translator
mistakenly creates different symbol tables for the two "feeder" entry
points, resulting in separate allocas for the same logical variable.

this commit fixes the bug by fusing the symbol tables for multiple
entry points to the same external function.

Description for the changelog

Cute Animal Picture

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

var_list and current_func did not need to be globals
@charles-cooper charles-cooper marked this pull request as ready for review June 17, 2024 14:47
@charles-cooper charles-cooper enabled auto-merge (squash) June 17, 2024 14:54
@charles-cooper charles-cooper merged commit c79c0b6 into vyperlang:master Jun 17, 2024
157 checks passed
@charles-cooper charles-cooper deleted the fix/venom-alloca-defaults branch June 17, 2024 15:23
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.

2 participants