Skip to content

Commit

Permalink
fix bytecodealliance#3749: returns count should count the returns, no…
Browse files Browse the repository at this point in the history
…t the params.
  • Loading branch information
Pat Hickey authored and alexcrichton committed Feb 2, 2022
1 parent 1ce22d8 commit 700eca7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ impl WasmFuncType {
#[inline]
pub fn new(params: Box<[WasmType]>, returns: Box<[WasmType]>) -> Self {
let externref_params_count = params.iter().filter(|p| **p == WasmType::ExternRef).count();
let externref_returns_count = params.iter().filter(|r| **r == WasmType::ExternRef).count();
let externref_returns_count = returns
.iter()
.filter(|r| **r == WasmType::ExternRef)
.count();
WasmFuncType {
params,
externref_params_count,
Expand Down

0 comments on commit 700eca7

Please sign in to comment.