File tree Expand file tree Collapse file tree 5 files changed +59
-5
lines changed Expand file tree Collapse file tree 5 files changed +59
-5
lines changed Original file line number Diff line number Diff line change 669
669
(module binary
670
670
" \00 asm" " \01\00\00\00 "
671
671
" \05\03\01 " ;; memory section with one entry
672
- " \08 " ;; malformed memory limits flag
672
+ " \10 " ;; malformed memory limits flag
673
673
" \00 " ;; dummy byte
674
674
)
675
675
" malformed limits flags"
Original file line number Diff line number Diff line change 17
17
)
18
18
)
19
19
)
20
+ (func $n2 (param $r (ref null $t )) (result i32 )
21
+ (call_ref $t
22
+ (ref.as_non_null
23
+ (block $l (result (ref null $t ))
24
+ (br_on_non_null $l (local.get $r ))
25
+ (return (i32.const -2 ))
26
+ )
27
+ )
28
+ )
29
+ )
20
30
21
31
(elem func $f )
22
32
(func $f (result i32 ) (i32.const 7 ))
23
33
24
- (func (export " nullable-null" ) (result i32 ) (call $n (ref.null $t )))
25
34
(func (export " nonnullable-f" ) (result i32 ) (call $nn (ref.func $f )))
35
+ (func (export " nullable-null" ) (result i32 ) (call $n (ref.null $t )))
26
36
(func (export " nullable-f" ) (result i32 ) (call $n (ref.func $f )))
37
+ (func (export " nullable2-null" ) (result i32 ) (call $n2 (ref.null $t )))
38
+ (func (export " nullable2-f" ) (result i32 ) (call $n2 (ref.func $f )))
27
39
28
40
(func (export " unreachable" ) (result i32 )
29
41
(block $l (result (ref $t ))
36
48
37
49
(assert_trap (invoke " unreachable" ) " unreachable" )
38
50
39
- (assert_return (invoke " nullable-null" ) (i32.const -1 ))
40
51
(assert_return (invoke " nonnullable-f" ) (i32.const 7 ))
52
+ (assert_return (invoke " nullable-null" ) (i32.const -1 ))
41
53
(assert_return (invoke " nullable-f" ) (i32.const 7 ))
54
+ (assert_return (invoke " nullable2-null" ) (i32.const -2 ))
55
+ (assert_return (invoke " nullable2-f" ) (i32.const 7 ))
42
56
43
57
(module
44
58
(type $t (func ))
Original file line number Diff line number Diff line change 390
390
" \0a\67\6c\6f\62\61\6c\5f\69\33\32 " ;; "global_i32"
391
391
" \03 " ;; GlobalImport
392
392
" \7f " ;; i32
393
- " \02 " ;; malformed mutability
393
+ " \04 " ;; malformed mutability
394
394
)
395
395
" malformed mutability"
396
396
)
417
417
" \06\86\80\80\80\00 " ;; global section
418
418
" \01 " ;; length 1
419
419
" \7f " ;; i32
420
- " \02 " ;; malformed mutability
420
+ " \04 " ;; malformed mutability
421
421
" \41\00 " ;; i32.const 0
422
422
" \0b " ;; end
423
423
)
Original file line number Diff line number Diff line change 19
19
(module (tag (result i32 )))
20
20
" non-empty tag result type"
21
21
)
22
+ (assert_invalid
23
+ (module (import " " " " (tag (result i32 ))))
24
+ " non-empty tag result type"
25
+ )
22
26
23
27
24
28
;; Link-time typing
Original file line number Diff line number Diff line change
1
+ ;; Syntax and Scoping
2
+
3
+ (module
4
+ (type (func (param (ref 0 )) (result (ref 0 ))))
5
+ (rec
6
+ (type (func (param (ref 2 ))))
7
+ (type (func (result (ref 1 ))))
8
+ )
9
+
10
+ (rec)
11
+ (rec (type (func )))
12
+ (rec (type $t (func )))
13
+ (rec (type $t1 (func )) (type (func )) (type $t2 (func )))
14
+ (rec (type $g (func (param (ref $g )) (result (ref $g )))))
15
+ (rec
16
+ (type $h (func (param (ref $k ))))
17
+ (type $k (func (result (ref $h ))))
18
+ )
19
+ )
20
+
21
+ (assert_invalid
22
+ (module
23
+ (type (func (param (ref 1 ))))
24
+ (type (func ))
25
+ )
26
+ " unknown type"
27
+ )
28
+ (assert_invalid
29
+ (module
30
+ (rec (type (func (param (ref 1 )))))
31
+ (rec (type (func )))
32
+ )
33
+ " unknown type"
34
+ )
35
+
36
+
1
37
;; Static matching of recursive types
2
38
3
39
(module
You can’t perform that action at this time.
0 commit comments