mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-23 02:01:55 +00:00
Nest: Several assumptions to tame the static analyzer
This commit is contained in:
parent
2efc73a9a0
commit
aaf2ae5613
@ -278,18 +278,22 @@ nexthop_merge(struct nexthop *x, struct nexthop *y, int rx, int ry, int max, lin
|
|||||||
while ((x || y) && max--)
|
while ((x || y) && max--)
|
||||||
{
|
{
|
||||||
int cmp = nexthop_compare_node(x, y);
|
int cmp = nexthop_compare_node(x, y);
|
||||||
|
|
||||||
if (cmp < 0)
|
if (cmp < 0)
|
||||||
{
|
{
|
||||||
|
ASSUME(x);
|
||||||
*n = rx ? x : nexthop_copy_node(x, lp);
|
*n = rx ? x : nexthop_copy_node(x, lp);
|
||||||
x = x->next;
|
x = x->next;
|
||||||
}
|
}
|
||||||
else if (cmp > 0)
|
else if (cmp > 0)
|
||||||
{
|
{
|
||||||
|
ASSUME(y);
|
||||||
*n = ry ? y : nexthop_copy_node(y, lp);
|
*n = ry ? y : nexthop_copy_node(y, lp);
|
||||||
y = y->next;
|
y = y->next;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ASSUME(x && y);
|
||||||
*n = rx ? x : (ry ? y : nexthop_copy_node(x, lp));
|
*n = rx ? x : (ry ? y : nexthop_copy_node(x, lp));
|
||||||
x = x->next;
|
x = x->next;
|
||||||
y = y->next;
|
y = y->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user