-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathbinary0.wast
More file actions
67 lines (61 loc) · 2.58 KB
/
binary0.wast
File metadata and controls
67 lines (61 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;; Unsigned LEB128 can have non-minimal length
(module binary
"\00asm" "\01\00\00\00"
"\05\07\02" ;; Memory section with 2 entries
"\00\82\00" ;; no max, minimum 2
"\00\82\00" ;; no max, minimum 2
)
(module binary
"\00asm" "\01\00\00\00"
"\05\13\03" ;; Memory section with 3 entries
"\00\83\80\80\80\00" ;; no max, minimum 3
"\00\84\80\80\80\00" ;; no max, minimum 4
"\00\85\80\80\80\00" ;; no max, minimum 5
)
(module binary
"\00asm" "\01\00\00\00"
"\05\05\02" ;; Memory section with 2 entries
"\00\00" ;; no max, minimum 0
"\00\00" ;; no max, minimum 0
"\0b\06\01" ;; Data section with 1 entry
"\00" ;; Memory index 0
"\41\00\0b\00" ;; (i32.const 0) with contents ""
)
(module binary
"\00asm" "\01\00\00\00"
"\05\05\02" ;; Memory section with 2 entries
"\00\00" ;; no max, minimum 0
"\00\01" ;; no max, minimum 1
"\0b\07\01" ;; Data section with 1 entry
"\02\01" ;; Memory index 1
"\41\00\0b\00" ;; (i32.const 0) with contents ""
)
(module binary
"\00asm" "\01\00\00\00"
"\05\05\02" ;; Memory section with 2 entries
"\00\00" ;; no max, minimum 0
"\00\01" ;; no max, minimum 1
"\0b\0a\01" ;; Data section with 1 entry
"\02\81\80\80\00" ;; Memory index 1
"\41\00\0b\00" ;; (i32.const 0) with contents ""
)
;; Unsigned LEB128 must not be overlong
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\05\10\02" ;; Memory section with 2 entries
"\00\01" ;; no max, minimum 1
"\00\82\80\80\80\80\80\80\80\80\80\80\00" ;; no max, minimum 2 with one byte too many
)
"integer representation too long"
)
;; 2 memories declared, 1 given
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\05\03\02" ;; memory section with inconsistent count (1 declared, 0 given)
"\00\00" ;; memory 0 (missed)
;; "\00\00" ;; memory 1 (missing)
)
"unexpected end of section or function"
)