Skip to content

Commit

Permalink
Simplify terminator instruction check
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Sep 10, 2019
1 parent ede79bd commit 8e97b9d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/evmone/analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,11 @@ code_analysis analyze(
else
analysis.instrs.emplace_back(fns[opcode]);

bool create_new_block = false;
switch (metrics.group)
{
default:
break;

case terminator:
create_new_block = true;
break;

case small_push:
{
const auto push_size = size_t(opcode - OP_PUSH1 + 1);
Expand Down Expand Up @@ -157,7 +152,7 @@ code_analysis analyze(
break;
}

if (create_new_block || (code_pos != code_end && *code_pos == OP_JUMPDEST))
if (metrics.group == terminator || (code_pos != code_end && *code_pos == OP_JUMPDEST))
{
// Save current block.
const auto stack_req = block.stack_req <= std::numeric_limits<int16_t>::max() ?
Expand Down

0 comments on commit 8e97b9d

Please sign in to comment.