Skip to content

Commit

Permalink
Add double rjumpi and rjumpv
Browse files Browse the repository at this point in the history
Signed-off-by: Danno Ferrin <danno@numisight.com>
  • Loading branch information
shemnon committed Sep 6, 2024
1 parent a370408 commit 91c641c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,3 +926,19 @@ def test_rjumpi_backwards_min_stack_wrong(
data=container,
expect_exception=EOFException.STACK_HEIGHT_MISMATCH,
)


def test_double_rjumpi(
eof_test: EOFTestFiller,
):
"""
Two RJUNMPIs, causing the min stack to underflow
"""
container = Container.Code(
code=(Op.PUSH0 + Op.PUSH0 + Op.RJUMPI[5] + Op.PUSH0 + Op.PUSH0 + Op.RJUMPI[0] + Op.RETURN),
max_stack_height=3,
)
eof_test(
data=container,
expect_exception=EOFException.STACK_UNDERFLOW,
)
16 changes: 16 additions & 0 deletions tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,3 +1202,19 @@ def test_rjumpv_backwards_min_stack_wrong(
data=container,
expect_exception=EOFException.STACK_HEIGHT_MISMATCH,
)


def test_double_rjumpv(
eof_test: EOFTestFiller,
):
"""
Two RJUMPVs, causing the min stack to underflow
"""
container = Container.Code(
code=(Op.PUSH0 + Op.PUSH0 + Op.RJUMPV[6] + Op.PUSH0 + Op.PUSH0 + Op.RJUMPV[0] + Op.RETURN),
max_stack_height=3,
)
eof_test(
data=container,
expect_exception=EOFException.STACK_UNDERFLOW,
)

0 comments on commit 91c641c

Please sign in to comment.