]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter: fixed error-checking bug in !~ operator
authorMaria Matejka <mq@ucw.cz>
Sat, 23 Mar 2019 12:32:14 +0000 (13:32 +0100)
committerMaria Matejka <mq@ucw.cz>
Sat, 23 Mar 2019 12:32:14 +0000 (13:32 +0100)
filter/f-inst.c
filter/test.conf

index 3fea16c46318b5d8c5c518b7b5092111ca5d3395..d6c292b681a7edca0a20b3df20cfd4bae467ff53 100644 (file)
     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);
   }
index b9f1b3aa45dcf04f89ec38ff46d93c4acd1760f1..ba25a34b8970e3b78fd1fd7597c891f5fa2686f0 100644 (file)
@@ -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);