From: Maria Matejka Date: Sat, 23 Mar 2019 12:32:14 +0000 (+0100) Subject: Filter: fixed error-checking bug in !~ operator X-Git-Tag: v2.0.5~10^2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe503c7c0632b385222c92b85d04526fdf36a1a3;p=thirdparty%2Fbird.git Filter: fixed error-checking bug in !~ operator --- diff --git a/filter/f-inst.c b/filter/f-inst.c index 3fea16c46..d6c292b68 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -233,7 +233,7 @@ ARG_ANY(1); ARG_ANY(2); int i = val_in_range(&v1, &v2); - if (res.val.i == F_CMP_ERROR) + if (i == F_CMP_ERROR) runtime( "!~ applied on unknown type pair" ); RESULT(T_BOOL, i, !i); } diff --git a/filter/test.conf b/filter/test.conf index b9f1b3aa4..ba25a34b8 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -136,6 +136,7 @@ int set is; bt_assert(2 ~ [ 1, 2, 3 ]); bt_assert(5 ~ [ 4 .. 7 ]); bt_assert(1 !~ [ 2, 3, 4 ]); + bt_assert(999 !~ [ 666, 333 ]); is = [ 2, 3, 4, 7..11 ]; bt_assert(10 ~ is);