vyper
vyper copied to clipboard
compiler panic on indexing empty literal arrays
Version Information
- vyper Version (output of
vyper --versionOR linkable commit hash vyperlang/vyper@): vyperlang/vyper@b43fface148b45cbd2c90b5d24f77398a63745b5
Issue Description
Indexing an empty array is not caught by the type checker and causes the code generation to fail with a compiler panic.
POC
Compiling the following contract will cause a compiler panic:
@external
def bar(x:uint128):
a:uint128 = empty(DynArray[uint128,2])[0]
vyper.exceptions.TypeCheckFailure: indexing into zero array not allowed