[master] 86ae6dc Always insert space around '+' and '-' in generated C-code to not accidentally produce '--' and '++' operators.

Poul-Henning Kamp phk at FreeBSD.org
Mon Jan 16 09:36:05 CET 2017


commit 86ae6dcfa265f380178396de06573a1ecebd8e13
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 16 08:33:56 2017 +0000

    Always insert space around '+' and '-' in generated C-code to
    not accidentally produce '--' and '++' operators.
    
    Fixes	#2184

diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index d97c5f7..415d54b 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -1023,7 +1023,7 @@ vcc_expr_add(struct vcc *tl, struct expr **e, vcc_type_t fmt)
 
 #define ADD_OK(op, a, b, c)						  \
 		if (tk->tok == op[0] && (*e)->fmt == a && e2->fmt == b) { \
-			*e = vcc_expr_edit(c, "(\v1" op "\v2)", *e, e2);  \
+			*e = vcc_expr_edit(c, "(\v1 " op " \v2)", *e, e2);\
 			continue;					  \
 		}							  \
 



More information about the varnish-commit mailing list