diff --git a/dev-test/Cargo.toml b/dev-test/Cargo.toml index 68ebc50..e7876f8 100644 --- a/dev-test/Cargo.toml +++ b/dev-test/Cargo.toml @@ -8,19 +8,15 @@ publish = false cargo-fuzz = true [dependencies] -libfuzzer-sys = "0.4" +libfuzzer-sys = "0.4.0" wasm-smith = "0.8.0" +wasm-ast = { path = "../wasm-ast" } codegen-luajit = { path = "../codegen/luajit" } codegen-luau = { path = "../codegen/luau" } -[dependencies.parity-wasm] -git = "https://github.com/paritytech/parity-wasm.git" -features = ["multi_value", "sign_ext"] - [dev-dependencies] test-generator = "0.3.0" wast = "41.0.0" -wasm-ast = { path = "../wasm-ast" } [[bin]] name = "luajit_translate" diff --git a/dev-test/tests/target.rs b/dev-test/tests/target.rs index 23655d2..6e06387 100644 --- a/dev-test/tests/target.rs +++ b/dev-test/tests/target.rs @@ -5,9 +5,9 @@ use std::{ process::Command, }; -use parity_wasm::elements::Module as BinModule; +use wasm_ast::module::Module as AstModule; use wast::{ - core::Module as AstModule, parser::ParseBuffer, token::Id, AssertExpression, QuoteWat, Wast, + core::Module as WaModule, parser::ParseBuffer, token::Id, AssertExpression, QuoteWat, Wast, WastDirective, WastExecute, WastInvoke, Wat, }; @@ -42,7 +42,7 @@ macro_rules! impl_write_number_nan { impl_write_number_nan!(write_f32, write_f32_nan, f32, wast::token::Float32); impl_write_number_nan!(write_f64, write_f64_nan, f64, wast::token::Float64); -fn try_into_ast_module(data: QuoteWat) -> Option { +fn try_into_ast_module(data: QuoteWat) -> Option { if let QuoteWat::Wat(Wat::Module(data)) = data { Some(data) } else { @@ -73,7 +73,7 @@ pub trait Target: Sized { fn write_runtime(w: &mut dyn Write) -> Result<()>; - fn write_module(data: &BinModule, name: Option<&str>, w: &mut dyn Write) -> Result<()>; + fn write_module(data: &AstModule, name: Option<&str>, w: &mut dyn Write) -> Result<()>; fn write_variant(variant: WastDirective, w: &mut dyn Write) -> Result<()> { match variant { @@ -81,7 +81,7 @@ pub trait Target: Sized { let mut ast = try_into_ast_module(data).expect("Must be a module"); let bytes = ast.encode().unwrap(); - let data = parity_wasm::deserialize_buffer(&bytes).unwrap(); + let data = AstModule::from_data(&bytes); let name = ast.id.as_ref().map(Id::name); Self::write_module(&data, name, w)?;