diff options
| author | Henry <mail@henrygressmann.de> | 2026-07-15 16:23:02 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-07-15 16:23:02 +0200 |
| commit | 957b62bf1d6205409bac94a4ced790dfb8007e3d (patch) | |
| tree | 4e7e580c4bb187c57e4e2dfb3ffe7fef5a1771bf /crates/cli | |
| parent | f99b3a90827406b48657d63d7c1f0188ddd68c8f (diff) | |
fix: 64 bit table addressing
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/cli')
| -rw-r--r-- | crates/cli/src/output.rs | 6 | ||||
| -rw-r--r-- | crates/cli/src/wast_runner.rs | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/crates/cli/src/output.rs b/crates/cli/src/output.rs index bc0e450..bf568ed 100644 --- a/crates/cli/src/output.rs +++ b/crates/cli/src/output.rs @@ -57,8 +57,12 @@ pub fn format_memory_type(ty: &MemoryType) -> String { } pub fn format_table_type(ty: &TableType) -> String { + let arch = match ty.arch() { + MemoryArch::I32 => "i32", + MemoryArch::I64 => "i64", + }; let max = ty.size_max.map(|v| v.to_string()).unwrap_or_else(|| "unbounded".to_string()); - format!("table[{}] initial={} max={max}", format_wasm_type(ty.element_type), ty.size_initial) + format!("table[{arch} {}] initial={} max={max}", format_wasm_type(ty.element_type), ty.size_initial) } pub fn format_global_type(ty: &GlobalType) -> String { diff --git a/crates/cli/src/wast_runner.rs b/crates/cli/src/wast_runner.rs index 0634e76..3c0a1cd 100644 --- a/crates/cli/src/wast_runner.rs +++ b/crates/cli/src/wast_runner.rs @@ -159,6 +159,11 @@ impl WastRunner { TableType::new(WasmType::RefFunc, 10, Some(20)), WasmValue::default_for(WasmType::RefFunc), )?; + let table64 = Table::new( + store, + TableType::new64(WasmType::RefFunc, 10, Some(20)), + WasmValue::default_for(WasmType::RefFunc), + )?; let memory = Memory::new(store, MemoryType::default().with_page_count_initial(1).with_page_count_max(Some(2)))?; let global_i32 = Global::new(store, tinywasm::types::GlobalType::new(WasmType::I32, false), WasmValue::I32(666))?; @@ -172,6 +177,7 @@ impl WastRunner { imports .define("spectest", "memory", memory) .define("spectest", "table", table) + .define("spectest", "table64", table64) .define("spectest", "global_i32", global_i32) .define("spectest", "global_i64", global_i64) .define("spectest", "global_f32", global_f32) |
