Skip to content

Commit

Permalink
Add Void constant for execution_result
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jul 15, 2020
1 parent f3f9a68 commit 010413a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ execution_result execute(Instance& instance, FuncIdx func_idx, span<const uint64
end:
// WebAssembly 1.0 allows at most one return variable.
assert(pc == &code.instructions[code.instructions.size()] && stack.size() <= 1);
return stack.size() != 0 ? stack.pop() : execution_result{};
return stack.size() != 0 ? stack.pop() : Void;

trap:
return Trap;
Expand Down
1 change: 1 addition & 0 deletions lib/fizzy/execute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct execution_result
constexpr explicit execution_result(trapped_tag) noexcept : trapped{true} {}
};

constexpr execution_result Void;
constexpr execution_result Trap{execution_result::trapped_tag{}};

struct Instance;
Expand Down

0 comments on commit 010413a

Please sign in to comment.