From a99e41e2caa54c220ef65db477001c6ea7f18dd2 Mon Sep 17 00:00:00 2001 From: Pierre Chambart Date: Mon, 7 Oct 2024 15:47:26 +0200 Subject: [PATCH] Fix br empty argument --- wasm/wat.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wasm/wat.ml b/wasm/wat.ml index 260658f84..1b0403f1f 100644 --- a/wasm/wat.ml +++ b/wasm/wat.ml @@ -255,8 +255,7 @@ module C = struct let tuple_make fields = match fields with - | [] -> atom "_____ishouldnotexist" - (* assert false *) + | [] -> assert false | [ field ] -> field | fields -> node "tuple.make" (Atom (List.length fields |> string_of_int) :: fields ) @@ -318,7 +317,10 @@ module C = struct nodehv "loop" [ !$(Block_id.name id); results result ] body let br id args = - node "br" [ !$(Block_id.name id); tuple_make args ] + match args with + | [] -> node "br" [ !$(Block_id.name id)] + | [arg] -> node "br" [ !$(Block_id.name id); arg ] + | _ -> node "br" [ !$(Block_id.name id); tuple_make args ] let br' id = node "br" [ !$(Block_id.name id) ]