vyperlang / vyper

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

`_handle_modification` Fails for `Call` Nodes #4105

Open ritzdorf opened 2 months ago

ritzdorf commented 2 months ago

Version Information

When an Call node is passed to _handle_modification, the function fails to handle it and the compiler panics with an unhandled exception.

POC

The following example demonstrates this behavior:

c: DynArray[DynArray[uint256, 2], 2]

@external
def foo():
    x: uint256 = self.c.pop().pop() # CompilerPanic: unhandled exception
trocher commented 2 weeks ago

Note: same behaviour for self.nested_array.pop().append(1) as found by @charles-cooper but probably not a bad thing that the compiler crashes given that both examples would lead to an invalid read/write