vyperlang / vyper

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

fix[codegen]: fix double eval in dynarray append/pop #4030

Closed charles-cooper closed 4 months ago

charles-cooper commented 4 months ago

append/pop does not have an eval once fence for the cases where it is in memory. add a fence.

What I did

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

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

cyberthirst commented 4 months ago
d:DynArray[DynArray[uint256,1],1]

@external
def foo() -> DynArray[uint256, 2]:
    self.d = [[0]]
    x:DynArray[uint256, 2] = [0,0]
    self.d[x.pop()] = [1]
    return x

now crashes with AssertionError: non-unique symbols {'pop_dynarray4'}