aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2025-11-15 18:48:16 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2025-11-15 18:48:16 +0100
commit0b2a1fd9439d5ab1cdc076d7b9f1e763c4900b74 (patch)
treea0a1724b1a8b2dbde94e938bb18b6ca4bb5ce800 /include
parent4a356bf56051361f2c72037f4fb043f8fdaa576c (diff)
downloadnanowasm-0b2a1fd9439d5ab1cdc076d7b9f1e763c4900b74.tar.gz
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.
Diffstat (limited to 'include')
-rw-r--r--include/nanowasm/private.h11
1 files changed, 10 insertions, 1 deletions
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;