forked from AbleOS/ableos
run_program takes slice now
This commit is contained in:
parent
ff703e5cb0
commit
00a7a884d8
|
@ -238,7 +238,7 @@ pub fn command_parser(user: String, command: String) {
|
||||||
let args = iter.collect::<Vec<&str>>();
|
let args = iter.collect::<Vec<&str>>();
|
||||||
println!("{:?}", args);
|
println!("{:?}", args);
|
||||||
if in_home || in_shared || in_system {
|
if in_home || in_shared || in_system {
|
||||||
run_program(binary_prog);
|
run_program(&binary_prog);
|
||||||
} else {
|
} else {
|
||||||
println!("No such binary: {}", bin_name);
|
println!("No such binary: {}", bin_name);
|
||||||
error!("No such binary: {}", bin_name);
|
error!("No such binary: {}", bin_name);
|
||||||
|
|
|
@ -100,9 +100,9 @@ pub fn interp() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_program(program: Vec<u8>) {
|
pub fn run_program(program: &[u8]) {
|
||||||
// Load wasm binary and prepare it for instantiation.
|
// Load wasm binary and prepare it for instantiation.
|
||||||
let module = wasmi::Module::from_buffer(&program).expect("failed to load wasm");
|
let module = wasmi::Module::from_buffer(program).expect("failed to load wasm");
|
||||||
|
|
||||||
trace!("Loaded wasm binary");
|
trace!("Loaded wasm binary");
|
||||||
let imports = ImportsBuilder::new().with_resolver("env", &host_functions::HostExternals {});
|
let imports = ImportsBuilder::new().with_resolver("env", &host_functions::HostExternals {});
|
||||||
|
|
Loading…
Reference in a new issue