Skip to content

Commit

Permalink
Test demonstrating unlimited SWAP/DUP problem with jumpdests
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Aug 1, 2019
1 parent 282ce35 commit f64876b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unittests/evm_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ TEST_F(evm, swapn_full_stack)
EXPECT_STATUS(EVMC_STACK_UNDERFLOW);
}

TEST_F(evm, swapsn_jumpdest)
{
rev = EVMC_PETERSBURG;
const auto code = push(4) + OP_JUMP + OP_SWAPSN + OP_JUMPDEST + push(0) + ret_top();

execute(code);
EXPECT_STATUS(EVMC_SUCCESS);

rev = EVMC_ISTANBUL;
execute(code);
EXPECT_STATUS(EVMC_BAD_JUMP_DESTINATION);
}

TEST_F(evm, memory_and_not)
{
execute(42, "600060018019815381518252800190f3");
Expand Down

0 comments on commit f64876b

Please sign in to comment.