Correctly count the number of wasm parameters. (#1337)
* Correctly count the number of wasm parameters. Following up on #1329, this further replaces `num_normal_params` with a function which calls `is_wasm_parameter` to correctly count the number of wasm parameters a function has. * Move is_wasm_parameter's implementation into the trait.
This commit is contained in:
@@ -88,16 +88,6 @@ impl Signature {
|
||||
.count()
|
||||
}
|
||||
|
||||
/// Count the number of normal parameters in a signature.
|
||||
/// Exclude special-purpose parameters that represent runtime stuff and not WebAssembly
|
||||
/// arguments.
|
||||
pub fn num_normal_params(&self) -> usize {
|
||||
self.params
|
||||
.iter()
|
||||
.filter(|arg| arg.purpose == ArgumentPurpose::Normal)
|
||||
.count()
|
||||
}
|
||||
|
||||
/// Does this signature take an struct return pointer parameter?
|
||||
pub fn uses_struct_return_param(&self) -> bool {
|
||||
self.uses_special_param(ArgumentPurpose::StructReturn)
|
||||
|
||||
Reference in New Issue
Block a user