File tree 3 files changed +42
-5
lines changed
3 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -651,14 +651,15 @@ let rec check_instr (c : context) (e : instr) (s : infer_result_type) : infer_in
651
651
" but the type annotation has " ^ string_of_result_type ts11)
652
652
in
653
653
let et = tag c y in
654
- let FuncT (_ , t) as ft = func_type_of_tag_type c et y.at in
655
- require (match_func_type c.types ( FuncT ( [] , t)) ft ) y.at
654
+ let FuncT (ts31 , t) = func_type_of_tag_type c et y.at in
655
+ require (ts31 = [] ) y.at
656
656
" type mismatch in switch tag" ;
657
657
require (match_result_type c.types ts12 t) y.at
658
658
" type mismatch in continuation types" ;
659
659
require (match_result_type c.types t ts22) y.at
660
660
" type mismatch in continuation types" ;
661
- ts11 --> ts21, []
661
+ let ts11' = Lib.List. lead ts11 in
662
+ (ts11' @ [RefT (Null , VarHT (StatX x.it))]) --> ts21, []
662
663
663
664
| Throw x ->
664
665
let FuncT (ts1, ts2) = func_type_of_tag_type c (tag c x) x.at in
Original file line number Diff line number Diff line change 35
35
simd_test_files = glob .glob (os .path .join (inputDir , "simd" , "*.wast" ))
36
36
gc_test_files = glob .glob (os .path .join (inputDir , "gc" , "*.wast" ))
37
37
multi_memory_test_files = glob .glob (os .path .join (inputDir , "multi-memory" , "*.wast" ))
38
- all_test_files = main_test_files + simd_test_files + gc_test_files + multi_memory_test_files
38
+ stack_switching_test_files = glob .glob (os .path .join (inputDir , "stack-switching" , "*.wast" ))
39
+ all_test_files = main_test_files + simd_test_files + gc_test_files + multi_memory_test_files + stack_switching_test_files
39
40
40
41
wasmExec = arguments .wasm
41
42
wasmCommand = wasmExec + " " + arguments .opts
Original file line number Diff line number Diff line change 1031
1031
(func
1032
1032
suspend $swap
1033
1033
)
1034
- )
1034
+ )
1035
+
1036
+ (module
1037
+ (type $ft0 (func ))
1038
+ (type $ct0 (cont $ft0 ))
1039
+
1040
+ (type $ft1 (func (param (ref $ct0 ))))
1041
+ (type $ct1 (cont $ft1 ))
1042
+
1043
+ (tag $t )
1044
+
1045
+ (func $f
1046
+ (cont.new $ct1 (ref.func $g ))
1047
+ (switch $ct1 $t )
1048
+ )
1049
+ (elem declare func $f )
1050
+
1051
+ (func $g (param (ref $ct0 )))
1052
+ (elem declare func $g )
1053
+
1054
+ (func $entry
1055
+ (cont.new $ct0 (ref.func $f ))
1056
+ (resume $ct0 (on $t switch))
1057
+ )
1058
+ )
1059
+
1060
+ (assert_invalid
1061
+ (module
1062
+ (rec
1063
+ (type $ft (func (param (ref $ct ))))
1064
+ (type $ct (cont $ft )))
1065
+ (tag $t (param i32 ))
1066
+
1067
+ (func (param $k (ref $ct ))
1068
+ (switch $ct $t )))
1069
+ " type mismatch in switch tag" )
You can’t perform that action at this time.
0 commit comments