Update dependencies (#30)

* dev-test: update dependencies

* update wasmparser: 0.99.0 -> 0.101.1

Remove `i64` generation fix for elements as they only contain `reftype` and not `i64`

* update wasmparser: 0.101.1 -> 0.103.0

See <https://github.com/bytecodealliance/wasm-tools/pull/957> for more information

* update wasmparser: 0.103.0 -> 0.106.0

* update wasmparser: 0.106.0 -> 0.107.0
This commit is contained in:
wackbyte 2023-06-26 17:19:12 -04:00 committed by GitHub
parent ef18bb1172
commit bbaa60e8c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 19 deletions

View File

@ -4,7 +4,7 @@ version = "0.12.0"
edition = "2021"
[dependencies]
wasmparser = "0.99.0"
wasmparser = "0.107.0"
[dependencies.wasm-ast]
path = "../../wasm-ast"

View File

@ -107,8 +107,8 @@ fn write_table_list(wasm: &Module, w: &mut dyn Write) -> Result<()> {
for (i, table) in table.iter().enumerate() {
let index = offset + i;
let min = table.initial;
let max = table.maximum.unwrap_or(0xFFFF);
let min = table.ty.initial;
let max = table.ty.maximum.unwrap_or(0xFFFF);
writeln!(
w,
@ -155,6 +155,8 @@ fn write_element_list(list: &[Element], type_info: &TypeInfo, w: &mut dyn Write)
unimplemented!("passive elements not supported")
};
let index = index.unwrap_or(0);
writeln!(w, "\tdo")?;
writeln!(w, "\t\tlocal target = TABLE_LIST[{index}].data")?;
write!(w, "\t\tlocal offset = ")?;

View File

@ -4,7 +4,7 @@ version = "0.12.0"
edition = "2021"
[dependencies]
wasmparser = "0.99.0"
wasmparser = "0.107.0"
[dependencies.wasm-ast]
path = "../../wasm-ast"

View File

@ -107,8 +107,8 @@ fn write_table_list(wasm: &Module, w: &mut dyn Write) -> Result<()> {
for (i, table) in table.iter().enumerate() {
let index = offset + i;
let min = table.initial;
let max = table.maximum.unwrap_or(0xFFFF);
let min = table.ty.initial;
let max = table.ty.maximum.unwrap_or(0xFFFF);
writeln!(
w,
@ -155,6 +155,8 @@ fn write_element_list(list: &[Element], type_info: &TypeInfo, w: &mut dyn Write)
unimplemented!("passive elements not supported")
};
let index = index.unwrap_or(0);
writeln!(w, "\tdo")?;
writeln!(w, "\t\tlocal target = TABLE_LIST[{index}].data")?;
write!(w, "\t\tlocal offset = ")?;
@ -243,9 +245,7 @@ fn write_localize_used(
.iter()
.any(|g| g.ty.content_type == ValType::I64);
let has_element_i64 = wasm.element_section().iter().any(|e| e.ty == ValType::I64);
if has_global_i64 || has_element_i64 {
if has_global_i64 {
loc_set.insert(("i64", "ZERO"));
loc_set.insert(("i64", "ONE"));
loc_set.insert(("i64", "from_u32"));

View File

@ -8,15 +8,15 @@ publish = false
cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4.0"
wasm-smith = "0.12.0"
libfuzzer-sys = "0.4.6"
wasm-smith = "0.12.10"
wasm-ast = { path = "../wasm-ast" }
codegen-luajit = { path = "../codegen/luajit" }
codegen-luau = { path = "../codegen/luau" }
[dev-dependencies]
test-generator = "0.3.0"
wast = "52.0.2"
test-generator = "0.3.1"
wast = "60.0.0"
[[bin]]
name = "luajit_translate"

View File

@ -4,4 +4,4 @@ version = "0.12.0"
edition = "2021"
[dependencies]
wasmparser = "0.99.0"
wasmparser = "0.107.0"

View File

@ -2,8 +2,7 @@ use std::collections::HashMap;
use wasmparser::{
BlockType, Data, Element, Export, ExternalKind, FunctionBody, Global, Import, LocalsReader,
MemoryType, Name, NameSectionReader, Parser, Payload, Result, TableType, Type, TypeRef,
ValType,
MemoryType, Name, NameSectionReader, Parser, Payload, Result, Table, Type, TypeRef, ValType,
};
#[derive(PartialEq, Eq, Clone, Copy)]
@ -58,7 +57,7 @@ pub struct Module<'a> {
type_section: Vec<Type>,
import_section: Vec<Import<'a>>,
func_section: Vec<u32>,
table_section: Vec<TableType>,
table_section: Vec<Table<'a>>,
memory_section: Vec<MemoryType>,
global_section: Vec<Global<'a>>,
export_section: Vec<Export<'a>>,
@ -173,7 +172,7 @@ impl<'a> Module<'a> {
}
#[must_use]
pub fn table_section(&self) -> &[TableType] {
pub fn table_section(&self) -> &[Table] {
&self.table_section
}
@ -256,7 +255,9 @@ impl<'a> TypeInfo<'a> {
}
pub(crate) fn by_type_index(&self, index: usize) -> (usize, usize) {
let Type::Func(ty) = &self.type_list[index];
let Type::Func(ty) = &self.type_list[index] else {
unreachable!("type at func index must be a func type");
};
(ty.params().len(), ty.results().len())
}