Skip to content

Commit d5b745e

Browse files
committed
Optimize call result push to the stack
1 parent 6f05239 commit d5b745e

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

lib/fizzy/execute.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,8 @@ inline bool invoke_function(const FuncType& func_type, const F& func, Instance&
495495

496496
stack.drop(num_args);
497497

498-
const auto num_outputs = func_type.outputs.size();
499-
// NOTE: we can assume these two from validation
500-
assert(num_outputs <= 1);
501-
assert(ret.has_value == (num_outputs == 1));
502498
// Push back the result
503-
if (num_outputs != 0)
499+
if (ret.has_value)
504500
stack.push(ret.value);
505501

506502
return true;

0 commit comments

Comments
 (0)