vyper icon indicating copy to clipboard operation
vyper copied to clipboard

`_handle_modification` Fails for `Call` Nodes

Open ritzdorf opened this issue 1 year ago • 2 comments

Version Information

  • vyper Version (output of vyper --version OR linkable commit hash vyperlang/vyper@): vyperlang/vyper@b43fface148b45cbd2c90b5d24f77398a63745b5

Issue Description

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

ritzdorf avatar Apr 25 '24 16:04 ritzdorf

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

trocher avatar Jun 19 '24 15:06 trocher