From: Maria Matejka Date: Mon, 11 Jul 2022 09:08:10 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/master' into backport X-Git-Tag: v2.0.11~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f;p=thirdparty%2Fbird.git Merge remote-tracking branch 'origin/master' into backport --- 2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f diff --cc filter/f-inst.c index 2c4c97b14,30db96f28..0fb04ba79 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@@ -1070,18 -1286,13 +1264,14 @@@ /* Push the body on stack */ LINEX(sym->function); + curline.vbase = curline.ventry; curline.emask |= FE_RETURN; - /* Before this instruction was called, there was the T_VOID - * automatic return value pushed on value stack and also - * sym->function->args function arguments. Setting the - * vbase to point to first argument. */ - ASSERT(curline.ventry >= sym->function->args); - curline.ventry -= sym->function->args; - curline.vbase = curline.ventry; + /* Arguments on stack */ + fstk->vcnt += sym->function->args; /* Storage for local variables */ + f_vcnt_check_overflow(sym->function->vars); memset(&(fstk->vstk[fstk->vcnt]), 0, sizeof(struct f_val) * sym->function->vars); fstk->vcnt += sym->function->vars; } diff --cc nest/a-path.c index badbc9115,6bb182859..c421b41f7 --- a/nest/a-path.c +++ b/nest/a-path.c @@@ -629,13 -631,13 +631,13 @@@ as_path_filter(struct linpool *pool, co u32 as = get_as(p); int match; - if (set) + if (set->type == T_SET) { - struct f_val v = {T_INT, .val.i = as}; + struct f_val v = { .type = T_INT, .val.i = as}; - match = !!find_tree(set, &v); + match = !!find_tree(set->val.t, &v); } - else - match = (as == key); + else /* T_INT */ + match = (as == set->val.i); if (match == pos) { diff --cc nest/a-path_test.c index e007a4504,97924c006..a0f3f0e33 --- a/nest/a-path_test.c +++ b/nest/a-path_test.c @@@ -127,8 -137,9 +128,9 @@@ t_path_include(void int counts_of_contains = count_asn_in_array(as_nums, as_nums[i]); bt_assert_msg(as_path_contains(as_path, as_nums[i], counts_of_contains), "AS Path should contains %d-times number %d", counts_of_contains, as_nums[i]); - bt_assert(as_path_filter(tmp_linpool, as_path, NULL, as_nums[i], 0) != NULL); - bt_assert(as_path_filter(tmp_linpool, as_path, NULL, as_nums[i], 1) != NULL); + struct f_val v = { .type = T_INT, .val.i = as_nums[i] }; - bt_assert(as_path_filter(lp, as_path, &v, 0) != NULL); - bt_assert(as_path_filter(lp, as_path, &v, 1) != NULL); ++ bt_assert(as_path_filter(tmp_linpool, as_path, &v, 0) != NULL); ++ bt_assert(as_path_filter(tmp_linpool, as_path, &v, 1) != NULL); } for (i = 0; i < 10000; i++)