Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ cable_add_compile_options(
-Wduplicate-enum
-Wlogical-op
-Wno-unknown-attributes
-falign-functions=32
-mbranches-within-32B-boundaries
)

if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
Expand Down
8 changes: 3 additions & 5 deletions lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down