From 0b2a1fd9439d5ab1cdc076d7b9f1e763c4900b74 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 15 Nov 2025 18:48:16 +0100 Subject: Add br_table br_table is in fact a generalization of other branch types like br or br_if, since br_table contains several branches for the same pc inside the nw_lo section. Therefore, this kind of branch forced some changes to nwp_break and those relying on it. --- include/nanowasm/private.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/nanowasm/private.h b/include/nanowasm/private.h index 6b134f1..4a378d3 100644 --- a/include/nanowasm/private.h +++ b/include/nanowasm/private.h @@ -307,6 +307,15 @@ union nw_i_sm union nw_value condition; } br_if; + struct nw_i_sm_br_table + { + int set; + nw_varuint32 target_count, target_i, relative_depth; + struct nw_sm_leb128 leb128; + struct nw_sm_io io; + long offset; + } br_table; + struct nw_i_sm_call { nw_varuint32 index; @@ -396,7 +405,7 @@ union nw_i_sm struct nw_i_sm_break { - nw_varuint32 relative_depth, label_i; + nw_varuint32 relative_depth, table_offset, label_i, toffset_i; struct nw_sm_io io; long pc, lo; struct nw_leuint32 offset, lpc, dst, n; -- cgit v1.2.3