Skip to content

Commit 9795397

Browse files
committed
A few more minor tests
1 parent 96afb2a commit 9795397

File tree

9 files changed

+32
-318
lines changed

9 files changed

+32
-318
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<'a> FromReader<'a> for CanonicalFunction {
288288
},
289289
0x0a => match reader.read_u8()? {
290290
0x7f => CanonicalFunction::ContextGet(reader.read_var_u32()?),
291-
x => return reader.invalid_leading_byte(x, "context.set intrinsic type"),
291+
x => return reader.invalid_leading_byte(x, "context.get intrinsic type"),
292292
},
293293
0x0b => match reader.read_u8()? {
294294
0x7f => CanonicalFunction::ContextSet(reader.read_var_u32()?),

tests/cli/component-model-async/task-builtins.wast

+15
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,21 @@
266266
"(core func (canon context.set i64 100))")
267267
"expected keyword `i32`")
268268

269+
(assert_malformed
270+
(component binary
271+
"\00asm" "\0d\00\01\00" ;; component header
272+
"\08\04" ;; canonicals section, 4 bytes
273+
"\01" ;; 1 count
274+
"\0a\7e\00") ;; context.get i64 0
275+
"invalid leading byte (0x7e) for context.get")
276+
(assert_malformed
277+
(component binary
278+
"\00asm" "\0d\00\01\00" ;; component header
279+
"\08\04" ;; canonicals section, 4 bytes
280+
"\01" ;; 1 count
281+
"\0b\7e\00") ;; context.set i64 0
282+
"invalid leading byte (0x7e) for context.set")
283+
269284
;; different forms of canonical intrinsics
270285

271286
(component

tests/snapshots/cli/component-model-async/task-builtins.wast.json

+16-2
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,23 @@
194194
"text": "expected keyword `i32`"
195195
},
196196
{
197-
"type": "module",
198-
"line": 271,
197+
"type": "assert_malformed",
198+
"line": 270,
199199
"filename": "task-builtins.29.wasm",
200+
"module_type": "binary",
201+
"text": "invalid leading byte (0x7e) for context.get"
202+
},
203+
{
204+
"type": "assert_malformed",
205+
"line": 277,
206+
"filename": "task-builtins.30.wasm",
207+
"module_type": "binary",
208+
"text": "invalid leading byte (0x7e) for context.set"
209+
},
210+
{
211+
"type": "module",
212+
"line": 286,
213+
"filename": "task-builtins.31.wasm",
200214
"module_type": "binary"
201215
}
202216
]

tests/snapshots/cli/component-model-async/task-builtins.wast/25.print

-63
This file was deleted.

tests/snapshots/cli/component-model-async/task-builtins.wast/26.print

-63
This file was deleted.

tests/snapshots/cli/component-model-async/task-builtins.wast/27.print

-63
This file was deleted.

tests/snapshots/cli/component-model-async/task-builtins.wast/28.print

-63
This file was deleted.

tests/snapshots/cli/component-model-async/task-builtins.wast/29.print

-63
This file was deleted.

0 commit comments

Comments
 (0)