diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2023-01-07 20:18:44 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2023-01-07 20:18:44 +0100 |
commit | e20bef69ccc4a85ef62359ee539c9db2dbe09127 (patch) | |
tree | 1b45ebbcb62cf8d8da5f4e173e39dc0b5e26e770 /filter/data.h | |
parent | d1cd5e5a63b2256eb71661f7438537e4ded7b01a (diff) |
Filter: Change linearization of branches in switch instruction
Most branching instructions (FI_CONDITION, FI_AND, FI_OR) linearize its
branches in a recursive way, while FI_SWITCH branches are linearized
from parser even before the switch instruction is allocated.
Change linearization of FI_SWITCH branches to make it similar to other
branching instructions. This also fixes an issue with constant
switch evaluation, where linearized branch is mistaken for
non-linearized during switch construction.
Thanks to Jiten Kumar Pathy for the bugreport.
Diffstat (limited to 'filter/data.h')
-rw-r--r-- | filter/data.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/filter/data.h b/filter/data.h index 5edeaedb..700609e9 100644 --- a/filter/data.h +++ b/filter/data.h @@ -198,6 +198,7 @@ struct f_trie_walk_state struct f_tree *f_new_tree(void); struct f_tree *build_tree(struct f_tree *); const struct f_tree *find_tree(const struct f_tree *t, const struct f_val *val); +const struct f_tree *find_tree_linear(const struct f_tree *t, const struct f_val *val); int same_tree(const struct f_tree *t0, const struct f_tree *t2); int tree_node_count(const struct f_tree *t); void tree_format(const struct f_tree *t, buffer *buf); |