vyperlang / vyper

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

fix[venom]: fix return opcode handling in mem2var #4011

Closed harkal closed 3 months ago

harkal commented 3 months ago

What I did

I fixed mem2var that was creating a bogus instruction in certain cases of returning values.

How I did it

How to verify it

Commit message

the `mem2var` venom pass was creating an `mstore` instruction with a
bogus output variable when promoting a variable to memory for `RETURN`s.

Description for the changelog

Cute Animal Picture

![Put a link to a cute animal picture inside the parenthesis-->]()

charles-cooper commented 3 months ago

do you have an example of source code where this change makes a difference?

harkal commented 3 months ago

do you have an example of source code where this change makes a difference?

No code currently will trigger an issue, but with upcoming changes I am making it does. Regardless a mstore instruction does not have outputs, so it needs fixing.