[master] c78361549 Allow BOOL [!=]= BOOL comparisons

Poul-Henning Kamp phk at FreeBSD.org
Mon Oct 29 12:01:11 UTC 2018


commit c783615498044430703a910393336a3a8edd30f9
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