Skip to content

Commit

Permalink
fix: add missing test for memory allocation overflow (#3650)
Browse files Browse the repository at this point in the history
should have been added in 68da04b but the file was not committed
  • Loading branch information
charles-cooper authored Oct 20, 2023
1 parent 3ba1412 commit ed0b1e0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/parser/features/test_memory_alloc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest

from vyper.compiler import compile_code
from vyper.exceptions import MemoryAllocationException


def test_memory_overflow():
code = """
@external
def zzz(x: DynArray[uint256, 2**59]): # 2**64 / 32 bytes per word == 2**59
y: uint256[7] = [0,0,0,0,0,0,0]
y[6] = y[5]
"""
with pytest.raises(MemoryAllocationException):
compile_code(code)

0 comments on commit ed0b1e0

Please sign in to comment.