vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.81k stars 788 forks source link

fix[venom]: alloca for default arguments #4155

Closed charles-cooper closed 2 weeks ago

charles-cooper commented 2 weeks ago

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-->]()