Skip to content

Commit

Permalink
Tweak performance 2
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 8, 2020
1 parent 15e88a3 commit e567b36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ execution_result execute(
case Instr::br_table:
{
const auto br_table_size = read<uint32_t>(immediates);
const auto arity = read<uint8_t>(immediates);
const auto arity = static_cast<uint8_t>(read<uint32_t>(immediates));

const auto br_table_idx = stack.pop();

Expand Down
2 changes: 1 addition & 1 deletion lib/fizzy/parser_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ parser_result<Code> parse_expr(
const auto default_branch_arity = get_branch_arity(default_branch_frame);

// arity is the same for all indices, so we push it once
push(code.immediates, default_branch_arity);
push(code.immediates, uint32_t{default_branch_arity});

// Remember immediates offset for all br items to fill them at end instruction.
for (const auto idx : label_indices)
Expand Down

0 comments on commit e567b36

Please sign in to comment.