diff --git a/Cargo.toml b/Cargo.toml index ddee98bd..686942bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ members = [ "crates/core", "crates/cli", ] +resolver = "2" [workspace.package] version = "1.1.2" diff --git a/crates/cli/src/wasm_generator/static.rs b/crates/cli/src/wasm_generator/static.rs index 84e2143a..dc8c569d 100644 --- a/crates/cli/src/wasm_generator/static.rs +++ b/crates/cli/src/wasm_generator/static.rs @@ -61,9 +61,15 @@ pub fn generate(js: &JS, exports: Vec) -> Result> { let invoke_export = invoke.id(); if !exports.is_empty() { - let ExportItem::Function(realloc_fn) = realloc.item else { unreachable!() }; - let ExportItem::Function(invoke_fn) = invoke.item else { unreachable!() }; - let ExportItem::Memory(memory) = memory.item else { unreachable!() }; + let ExportItem::Function(realloc_fn) = realloc.item else { + unreachable!() + }; + let ExportItem::Function(invoke_fn) = invoke.item else { + unreachable!() + }; + let ExportItem::Memory(memory) = memory.item else { + unreachable!() + }; export_exported_js_functions(&mut module, realloc_fn, invoke_fn, memory, exports); } diff --git a/crates/quickjs-wasm-rs/src/js_binding/context.rs b/crates/quickjs-wasm-rs/src/js_binding/context.rs index 7eeccf3d..48ee7690 100644 --- a/crates/quickjs-wasm-rs/src/js_binding/context.rs +++ b/crates/quickjs-wasm-rs/src/js_binding/context.rs @@ -173,7 +173,7 @@ impl JSContextRef { JS_WRITE_OBJ_BYTECODE as i32, ); Ok(Vec::from_raw_parts( - output_buffer as *mut u8, + output_buffer, output_size.try_into()?, output_size.try_into()?, ))