[6.0] 16033c289 Allow BOOL [!=]= BOOL comparisons
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Tue Feb 5 16:30:16 UTC 2019
commit 16033c289e47507870ee48cf9935f9f22aa10230
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Oct 29 11:59:44 2018 +0000
Allow BOOL [!=]= BOOL comparisons
Fixes: #2809
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index 1f0699e19..780befa0c 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -1111,6 +1111,8 @@ static const struct cmps vcc_cmps[] = {
IDENT_REL(SUB),
IDENT_REL(INSTANCE),
+ {BOOL, T_EQ, cmp_simple, "((!(\v1)) == (!(\v2)))" },
+ {BOOL, T_NEQ, cmp_simple, "((!(\v1)) != (!(\v2)))" },
{IP, T_EQ, cmp_simple, "!VRT_ipcmp(\v1, \v2)" },
{IP, T_NEQ, cmp_simple, "VRT_ipcmp(\v1, \v2)" },
@@ -1144,9 +1146,6 @@ vcc_expr_cmp(struct vcc *tl, struct expr **e, vcc_type_t fmt)
ERRCHK(tl);
tk = tl->t;
- if ((*e)->fmt == BOOL)
- return;
-
for (cp = vcc_cmps; cp->fmt != VOID; cp++) {
if ((*e)->fmt == cp->fmt && tl->t->tok == cp->token) {
AN(cp->func);
More information about the varnish-commit
mailing list