File tree 2 files changed +5
-5
lines changed
Modules/Virtual_machine/src
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ impl<'module> Instance_type<'module> {
102
102
& self ,
103
103
Name : & str ,
104
104
Parameters : & Vec < WasmValue > ,
105
- ) -> Result_type < WasmValue > {
105
+ ) -> Result_type < Vec < WasmValue > > {
106
106
if Parameters . is_empty ( ) {
107
107
Ok (
108
108
Function :: find_export_func ( self . Get_inner_reference ( ) , Name ) ?
@@ -116,15 +116,15 @@ impl<'module> Instance_type<'module> {
116
116
}
117
117
}
118
118
119
- pub fn Call_main ( & self , Parameters : & Vec < WasmValue > ) -> Result_type < WasmValue > {
119
+ pub fn Call_main ( & self , Parameters : & Vec < WasmValue > ) -> Result_type < Vec < WasmValue > > {
120
120
self . Call_export_function ( "_start" , Parameters )
121
121
}
122
122
123
123
pub fn Allocate < T > ( & mut self , Size : usize ) -> Result_type < * mut T > {
124
124
let Result = self . Call_export_function ( "Allocate" , & vec ! [ WasmValue :: I32 ( Size as i32 ) ] ) ?;
125
125
126
- if let WasmValue :: I32 ( Pointer ) = Result {
127
- let Pointer = unsafe { self . Convert_to_native_pointer ( Pointer as u32 ) } ;
126
+ if let Some ( WasmValue :: I32 ( Pointer ) ) = Result . first ( ) {
127
+ let Pointer = unsafe { self . Convert_to_native_pointer ( * Pointer as u32 ) } ;
128
128
129
129
Ok ( Pointer )
130
130
} else {
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ impl Manager_type {
109
109
Standard_in : Unique_file_identifier_type ,
110
110
Standard_out : Unique_file_identifier_type ,
111
111
Standard_error : Unique_file_identifier_type ,
112
- ) -> Result_type < WasmValue > {
112
+ ) -> Result_type < Vec < WasmValue > > {
113
113
let Module = Module_type :: From_buffer (
114
114
& self . Runtime ,
115
115
Buffer ,
You can’t perform that action at this time.
0 commit comments