@@ -266,15 +266,15 @@ pub enum RuntimeFunction {
266266}
267267
268268impl RuntimeFunction {
269- pub fn ty ( & self ) -> RuntimeSignature {
269+ pub fn signature ( & self ) -> RuntimeSignature {
270270 match self {
271271 RuntimeFunction :: Wasm { runtime_sig, .. } => * runtime_sig,
272272 RuntimeFunction :: Host { runtime_sig, .. } => * runtime_sig,
273273 }
274274 }
275275
276276 pub fn param_count ( & self ) -> usize {
277- self . ty ( ) . n_params ( ) as usize
277+ self . signature ( ) . n_params ( ) as usize
278278 }
279279
280280 pub fn new_host (
@@ -384,7 +384,7 @@ impl Instance {
384384 let runtime_sig = RuntimeSignature :: from_signature ( & function. ty ) ;
385385 match imported {
386386 ExportValue :: Function ( f) => {
387- if f. ty ( ) != runtime_sig { return Err ( Error :: Link ( INCOMPATIBLE_IMPORT ) ) ; }
387+ if f. signature ( ) != runtime_sig { return Err ( Error :: Link ( INCOMPATIBLE_IMPORT ) ) ; }
388388 inst. functions . push ( f. clone ( ) ) ;
389389 }
390390 _ => return Err ( Error :: Link ( INCOMPATIBLE_IMPORT ) ) ,
@@ -539,7 +539,7 @@ impl Instance {
539539 if module. start != u32:: MAX {
540540 let fi = module. start as usize ;
541541 let function = & inst_rc. functions [ fi] ;
542- if function. ty ( ) . n_params ( ) != 0 || function. ty ( ) . has_result ( ) { return Err ( Error :: Validation ( START_FUNC ) ) ; }
542+ if function. signature ( ) . n_params ( ) != 0 || function. signature ( ) . has_result ( ) { return Err ( Error :: Validation ( START_FUNC ) ) ; }
543543 let mut stack = Vec :: with_capacity ( 64 ) ;
544544 let mut return_pc = 0usize ;
545545 let mut control: Vec < ControlFrame > = Vec :: new ( ) ;
@@ -1083,7 +1083,7 @@ impl Instance {
10831083 InstanceManager :: with ( |mgr| {
10841084 if let Some ( owner) = mgr. get_instance ( owner_id) {
10851085 let callee = & owner. functions [ func_idx] ;
1086- sig_ok = callee. ty ( ) == expected;
1086+ sig_ok = callee. signature ( ) == expected;
10871087 if sig_ok {
10881088 let n_params = callee. param_count ( ) ;
10891089 let params_start = stack. len ( ) - n_params;
@@ -1115,7 +1115,7 @@ impl Instance {
11151115 }
11161116
11171117 let callee = self . functions [ func_idx] . clone ( ) ;
1118- if callee. ty ( ) != expected {
1118+ if callee. signature ( ) != expected {
11191119 return Err ( Error :: Trap ( INDIRECT_CALL_MISMATCH ) ) ;
11201120 }
11211121
0 commit comments