Skip to content

Commit

Permalink
Merge pull request #429 from wasmx/drop-operand-fix
Browse files Browse the repository at this point in the history
Remove redundant check from drop_operand
  • Loading branch information
gumb0 authored Jul 22, 2020
2 parents 62aaee7 + 67fa81c commit cb62d80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/fizzy/parser_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ inline void drop_operand(
static_cast<int>(operand_stack.size()) < frame.parent_stack_height + 1)
throw validation_error{"stack underflow"};

if (frame.unreachable && static_cast<int>(operand_stack.size()) == frame.parent_stack_height)
if (static_cast<int>(operand_stack.size()) == frame.parent_stack_height)
{
assert(frame.unreachable); // implied from stack underflow check above
return;
}

const auto actual_type = operand_stack.pop();
if (expected_type.has_value() && actual_type != *expected_type)
Expand Down

0 comments on commit cb62d80

Please sign in to comment.