Skip to content

test_rjumpv_skips_stack_underflow()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py::test_rjumpv_skips_stack_underflow@49a16fac.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py::test_rjumpv_skips_stack_underflow --fork Osaka

EOF code containing RJUMPV where the default path produces a stack underflow.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
@pytest.mark.parametrize(
    "table_size",
    [
        pytest.param(1, id="t1"),
        pytest.param(256, id="t256"),
    ],
)
def test_rjumpv_skips_stack_underflow(
    eof_test: EOFTestFiller,
    table_size: int,
):
    """EOF code containing RJUMPV where the default path produces a stack underflow."""
    jump_table = [1 for _ in range(table_size)]
    eof_test(
        container=Container(
            sections=[
                Section.Code(code=Op.ORIGIN + Op.RJUMPV[jump_table] + Op.POP + Op.STOP),
            ],
        ),
        expect_exception=EOFException.STACK_UNDERFLOW,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) table_size
...fork_Osaka-eof_test-t1 1
...fork_Osaka-eof_test-t256 256