Skip to content

Commit 93e9f4b

Browse files
committed
Wasm output: accept Seq anywhere
1 parent d9ef933 commit 93e9f4b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/lib-wasm/wasm_output.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,9 @@ end = struct
550550
List.iter ~f:(fun e' -> output_expression st ch e') l;
551551
output_byte ch 0x10;
552552
output_uint ch (Code.Var.Hashtbl.find st.func_names f)
553-
| Seq _ -> assert false
553+
| Seq (l, e') ->
554+
List.iter ~f:(fun i' -> output_instruction st ch i') l;
555+
output_expression st ch e'
554556
| Pop _ -> ()
555557
| RefFunc f ->
556558
Feature.require reference_types;
@@ -939,7 +941,9 @@ end = struct
939941
List.fold_left ~f:(fun set i -> instr_function_references i set) ~init:set l
940942
| Call (_, l) | ArrayNewFixed (_, l) | StructNew (_, l) ->
941943
List.fold_left ~f:(fun set i -> expr_function_references i set) ~init:set l
942-
| Seq _ -> assert false
944+
| Seq (l, e) ->
945+
List.fold_left ~f:(fun set i -> instr_function_references i set) ~init:set l
946+
|> expr_function_references e
943947
| RefFunc f -> Code.Var.Set.add f set
944948
| Call_ref (_, e', l) ->
945949
List.fold_left

0 commit comments

Comments
 (0)