Skip to content

Commit bfd9543

Browse files
committed
Optimize call result push to the stack
1 parent d7d923f commit bfd9543

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/fizzy/execute.cpp

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

441441
stack.drop(num_args);
442442

443-
const auto num_outputs = func_type.outputs.size();
444-
// NOTE: we can assume these two from validation
445-
assert(num_outputs <= 1);
446-
assert(ret.has_value == (num_outputs == 1));
447443
// Push back the result
448-
if (num_outputs != 0)
444+
if (ret.has_value)
449445
stack.push(ret.value);
450446

451447
return true;

0 commit comments

Comments
 (0)