We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88acffc commit a9799d5Copy full SHA for a9799d5
compiler/lib/wasm/wa_wat_output.ml
@@ -478,16 +478,13 @@ let expression_or_instructions ctx st in_function =
478
]
479
| Try (ty, body, catches) ->
480
[ List
481
- (Atom "try"
+ (Atom "try_table"
482
:: (block_type st ty
483
- @ List (Atom "do" :: instructions body)
484
- :: List.map
485
- ~f:(fun (tag, i, ty) ->
486
- List
487
- (Atom "catch"
488
- :: index st.tag_names tag
489
- :: instruction (Wa_ast.Br (i + 1, Some (Pop ty)))))
490
- catches))
+ @ List.map
+ ~f:(fun (tag, i, _ty) ->
+ List [ Atom "catch"; index st.tag_names tag; Atom (string_of_int i) ])
+ catches
+ @ instructions body))
491
492
and instruction i =
493
match i with
0 commit comments