diff --git a/CMakeLists.txt b/CMakeLists.txt index badb0bb74..8b892d527 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/lib/fizzy/execute.cpp b/lib/fizzy/execute.cpp index 1992d720d..1650a24e8 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;