diff --git a/lib/fizzy/execute.cpp b/lib/fizzy/execute.cpp index 1992d720d0..1650a24e8f 100644 --- a/lib/fizzy/execute.cpp +++ b/lib/fizzy/execute.cpp @@ -524,12 +524,10 @@ inline bool invoke_function(const FuncType& func_type, uint32_t func_idx, Instan stack.drop(num_args); - const auto num_outputs = func_type.outputs.size(); - // NOTE: we can assume these two from validation - assert(num_outputs <= 1); - assert(ret.has_value == (num_outputs == 1)); + // NOTE: validation ensures there is at most 1 output value + assert(func_type.outputs.size() == (ret.has_value ? 1 : 0)); // Push back the result - if (num_outputs != 0) + if (ret.has_value) stack.push(ret.value); return true;