Skip to content

Commit 7816043

Browse files
committed
update repos
spec: b42efa9b07c5544079c31f6088a66bead617559c
1 parent b280064 commit 7816043

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5974
-4869
lines changed

address.wast

+84-84
Large diffs are not rendered by default.

align.wast

+143-143
Large diffs are not rendered by default.

binary.wast

+55-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
(module binary
129129
"\00asm" "\01\00\00\00"
130130
"\04\04\01" ;; Table section with 1 entry
131-
"\70\00\00" ;; no max, minimum 0, anyfunc
131+
"\70\00\00" ;; no max, minimum 0, funcref
132132
"\09\07\01" ;; Element section with 1 entry
133133
"\80\00" ;; Table index 0, encoded with 2 bytes
134134
"\41\00\0b\00" ;; (i32.const 0) with no elements
@@ -573,7 +573,7 @@
573573
)
574574

575575
;; No more than 2^32 locals.
576-
(assert_malformed
576+
(assert_malformed
577577
(module binary
578578
"\00asm" "\01\00\00\00"
579579
"\01\04\01\60\00\00" ;; Type section
@@ -588,3 +588,56 @@
588588
)
589589
"too many locals"
590590
)
591+
592+
;; Function section has non-zero count, but code section is absent.
593+
(assert_malformed
594+
(module binary
595+
"\00asm" "\01\00\00\00"
596+
"\01\04\01\60\00\00" ;; Type section
597+
"\03\03\02\00\00" ;; Function section with 2 functions
598+
)
599+
"function and code section have inconsistent lengths"
600+
)
601+
602+
;; Code section has non-zero count, but function section is absent.
603+
(assert_malformed
604+
(module binary
605+
"\00asm" "\01\00\00\00"
606+
"\0a\04\01\02\00\0b" ;; Code section with 1 empty function
607+
)
608+
"function and code section have inconsistent lengths"
609+
)
610+
611+
;; Function section count > code section count
612+
(assert_malformed
613+
(module binary
614+
"\00asm" "\01\00\00\00"
615+
"\01\04\01\60\00\00" ;; Type section
616+
"\03\03\02\00\00" ;; Function section with 2 functions
617+
"\0a\04\01\02\00\0b" ;; Code section with 1 empty function
618+
)
619+
"function and code section have inconsistent lengths"
620+
)
621+
622+
;; Function section count < code section count
623+
(assert_malformed
624+
(module binary
625+
"\00asm" "\01\00\00\00"
626+
"\01\04\01\60\00\00" ;; Type section
627+
"\03\02\01\00" ;; Function section with 1 function
628+
"\0a\07\02\02\00\0b\02\00\0b" ;; Code section with 2 empty functions
629+
)
630+
"function and code section have inconsistent lengths"
631+
)
632+
633+
;; Function section has zero count, and code section is absent.
634+
(module binary
635+
"\00asm" "\01\00\00\00"
636+
"\03\01\00" ;; Function section with 0 functions
637+
)
638+
639+
;; Code section has zero count, and function section is absent.
640+
(module binary
641+
"\00asm" "\01\00\00\00"
642+
"\0a\01\00" ;; Code section with 0 functions
643+
)

block.wast

+27-27
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@
114114
(block (result i32) (i32.const 2) (block (result i32) (i32.const 1)) (br_table 0 0))
115115
)
116116

117-
(func $func (param i32 i32) (result i32) (get_local 0))
117+
(func $func (param i32 i32) (result i32) (local.get 0))
118118
(type $check (func (param i32 i32) (result i32)))
119-
(table anyfunc (elem $func))
119+
(table funcref (elem $func))
120120
(func (export "as-call_indirect-first") (result i32)
121121
(block (result i32)
122122
(call_indirect (type $check)
@@ -150,7 +150,7 @@
150150
(memory.grow (block (result i32) (i32.const 1)))
151151
)
152152

153-
(func $f (param i32) (result i32) (get_local 0))
153+
(func $f (param i32) (result i32) (local.get 0))
154154

155155
(func (export "as-call-value") (result i32)
156156
(call $f (block (result i32) (i32.const 1)))
@@ -164,16 +164,16 @@
164164
(func (export "as-br-value") (result i32)
165165
(block (result i32) (br 0 (block (result i32) (i32.const 1))))
166166
)
167-
(func (export "as-set_local-value") (result i32)
168-
(local i32) (set_local 0 (block (result i32) (i32.const 1))) (get_local 0)
167+
(func (export "as-local.set-value") (result i32)
168+
(local i32) (local.set 0 (block (result i32) (i32.const 1))) (local.get 0)
169169
)
170-
(func (export "as-tee_local-value") (result i32)
171-
(local i32) (tee_local 0 (block (result i32) (i32.const 1)))
170+
(func (export "as-local.tee-value") (result i32)
171+
(local i32) (local.tee 0 (block (result i32) (i32.const 1)))
172172
)
173173
(global $a (mut i32) (i32.const 10))
174-
(func (export "as-set_global-value") (result i32)
175-
(set_global $a (block (result i32) (i32.const 1)))
176-
(get_global $a)
174+
(func (export "as-global.set-value") (result i32)
175+
(global.set $a (block (result i32) (i32.const 1)))
176+
(global.get $a)
177177
)
178178

179179
(func (export "as-load-operand") (result i32)
@@ -223,29 +223,29 @@
223223
)
224224
(func (export "break-inner") (result i32)
225225
(local i32)
226-
(set_local 0 (i32.const 0))
227-
(set_local 0 (i32.add (get_local 0) (block (result i32) (block (result i32) (br 1 (i32.const 0x1))))))
228-
(set_local 0 (i32.add (get_local 0) (block (result i32) (block (br 0)) (i32.const 0x2))))
229-
(set_local 0
230-
(i32.add (get_local 0) (block (result i32) (i32.ctz (br 0 (i32.const 0x4)))))
226+
(local.set 0 (i32.const 0))
227+
(local.set 0 (i32.add (local.get 0) (block (result i32) (block (result i32) (br 1 (i32.const 0x1))))))
228+
(local.set 0 (i32.add (local.get 0) (block (result i32) (block (br 0)) (i32.const 0x2))))
229+
(local.set 0
230+
(i32.add (local.get 0) (block (result i32) (i32.ctz (br 0 (i32.const 0x4)))))
231231
)
232-
(set_local 0
233-
(i32.add (get_local 0) (block (result i32) (i32.ctz (block (result i32) (br 1 (i32.const 0x8))))))
232+
(local.set 0
233+
(i32.add (local.get 0) (block (result i32) (i32.ctz (block (result i32) (br 1 (i32.const 0x8))))))
234234
)
235-
(get_local 0)
235+
(local.get 0)
236236
)
237237

238238
(func (export "effects") (result i32)
239239
(local i32)
240240
(block
241-
(set_local 0 (i32.const 1))
242-
(set_local 0 (i32.mul (get_local 0) (i32.const 3)))
243-
(set_local 0 (i32.sub (get_local 0) (i32.const 5)))
244-
(set_local 0 (i32.mul (get_local 0) (i32.const 7)))
241+
(local.set 0 (i32.const 1))
242+
(local.set 0 (i32.mul (local.get 0) (i32.const 3)))
243+
(local.set 0 (i32.sub (local.get 0) (i32.const 5)))
244+
(local.set 0 (i32.mul (local.get 0) (i32.const 7)))
245245
(br 0)
246-
(set_local 0 (i32.mul (get_local 0) (i32.const 100)))
246+
(local.set 0 (i32.mul (local.get 0) (i32.const 100)))
247247
)
248-
(i32.eq (get_local 0) (i32.const -14))
248+
(i32.eq (local.get 0) (i32.const -14))
249249
)
250250
)
251251

@@ -285,9 +285,9 @@
285285
(assert_return (invoke "as-return-value") (i32.const 1))
286286
(assert_return (invoke "as-drop-operand"))
287287
(assert_return (invoke "as-br-value") (i32.const 1))
288-
(assert_return (invoke "as-set_local-value") (i32.const 1))
289-
(assert_return (invoke "as-tee_local-value") (i32.const 1))
290-
(assert_return (invoke "as-set_global-value") (i32.const 1))
288+
(assert_return (invoke "as-local.set-value") (i32.const 1))
289+
(assert_return (invoke "as-local.tee-value") (i32.const 1))
290+
(assert_return (invoke "as-global.set-value") (i32.const 1))
291291
(assert_return (invoke "as-load-operand") (i32.const 1))
292292

293293
(assert_return (invoke "as-unary-operand") (i32.const 0))

br.wast

+17-17
Original file line numberDiff line numberDiff line change
@@ -95,29 +95,29 @@
9595
)
9696
(func (export "as-if-then") (param i32 i32) (result i32)
9797
(block (result i32)
98-
(if (result i32) (get_local 0)
98+
(if (result i32) (local.get 0)
9999
(then (br 1 (i32.const 3)))
100-
(else (get_local 1))
100+
(else (local.get 1))
101101
)
102102
)
103103
)
104104
(func (export "as-if-else") (param i32 i32) (result i32)
105105
(block (result i32)
106-
(if (result i32) (get_local 0)
107-
(then (get_local 1))
106+
(if (result i32) (local.get 0)
107+
(then (local.get 1))
108108
(else (br 1 (i32.const 4)))
109109
)
110110
)
111111
)
112112

113113
(func (export "as-select-first") (param i32 i32) (result i32)
114114
(block (result i32)
115-
(select (br 0 (i32.const 5)) (get_local 0) (get_local 1))
115+
(select (br 0 (i32.const 5)) (local.get 0) (local.get 1))
116116
)
117117
)
118118
(func (export "as-select-second") (param i32 i32) (result i32)
119119
(block (result i32)
120-
(select (get_local 0) (br 0 (i32.const 6)) (get_local 1))
120+
(select (local.get 0) (br 0 (i32.const 6)) (local.get 1))
121121
)
122122
)
123123
(func (export "as-select-cond") (result i32)
@@ -144,7 +144,7 @@
144144
)
145145

146146
(type $sig (func (param i32 i32 i32) (result i32)))
147-
(table anyfunc (elem $f))
147+
(table funcref (elem $f))
148148
(func (export "as-call_indirect-func") (result i32)
149149
(block (result i32)
150150
(call_indirect (type $sig)
@@ -178,15 +178,15 @@
178178
)
179179
)
180180

181-
(func (export "as-set_local-value") (result i32) (local f32)
182-
(block (result i32) (set_local 0 (br 0 (i32.const 17))) (i32.const -1))
181+
(func (export "as-local.set-value") (result i32) (local f32)
182+
(block (result i32) (local.set 0 (br 0 (i32.const 17))) (i32.const -1))
183183
)
184-
(func (export "as-tee_local-value") (result i32) (local i32)
185-
(block (result i32) (tee_local 0 (br 0 (i32.const 1))))
184+
(func (export "as-local.tee-value") (result i32) (local i32)
185+
(block (result i32) (local.tee 0 (br 0 (i32.const 1))))
186186
)
187187
(global $a (mut i32) (i32.const 10))
188-
(func (export "as-set_global-value") (result i32)
189-
(block (result i32) (set_global $a (br 0 (i32.const 1))))
188+
(func (export "as-global.set-value") (result i32)
189+
(block (result i32) (global.set $a (br 0 (i32.const 1))))
190190
)
191191

192192
(memory 1)
@@ -242,7 +242,7 @@
242242
)
243243

244244
(func (export "as-convert-operand") (result i32)
245-
(block (result i32) (i32.wrap/i64 (br 0 (i32.const 41))))
245+
(block (result i32) (i32.wrap_i64 (br 0 (i32.const 41))))
246246
)
247247

248248
(func (export "as-memory.grow-size") (result i32)
@@ -383,9 +383,9 @@
383383
(assert_return (invoke "as-call_indirect-mid") (i32.const 22))
384384
(assert_return (invoke "as-call_indirect-last") (i32.const 23))
385385

386-
(assert_return (invoke "as-set_local-value") (i32.const 17))
387-
(assert_return (invoke "as-tee_local-value") (i32.const 1))
388-
(assert_return (invoke "as-set_global-value") (i32.const 1))
386+
(assert_return (invoke "as-local.set-value") (i32.const 17))
387+
(assert_return (invoke "as-local.tee-value") (i32.const 1))
388+
(assert_return (invoke "as-global.set-value") (i32.const 1))
389389

390390
(assert_return (invoke "as-load-address") (f32.const 1.7))
391391
(assert_return (invoke "as-loadN-address") (i64.const 30))

0 commit comments

Comments
 (0)