Skip to content

Commit abaec1e

Browse files
committed
threads: use 0x24 to encode thread.spawn_indirect
This encoding change is necessary due to recent additions to the component model; see [bytecodealliance#447]. [bytecodealliance#447]: WebAssembly/component-model#447
1 parent 7026933 commit abaec1e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/wasm-encoder/src/component/canonicals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl CanonicalFunctionSection {
170170
/// Defines a function which will spawn a new thread by invoking a shared
171171
/// function indirectly through a `funcref` table.
172172
pub fn thread_spawn_indirect(&mut self, table_index: u32) -> &mut Self {
173-
self.bytes.push(0x07);
173+
self.bytes.push(0x24);
174174
table_index.encode(&mut self.bytes);
175175
self.num_added += 1;
176176
self

crates/wasmparser/src/readers/component/canonicals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl<'a> FromReader<'a> for CanonicalFunction {
285285
0x05 => CanonicalFunction::ThreadSpawn {
286286
func_ty_index: reader.read()?,
287287
},
288-
0x07 => CanonicalFunction::ThreadSpawnIndirect {
288+
0x24 => CanonicalFunction::ThreadSpawnIndirect {
289289
table_index: reader.read()?,
290290
},
291291
0x06 => CanonicalFunction::ThreadHwConcurrency,

0 commit comments

Comments
 (0)