[PATCH 2/2] Don't consider a vcc expr to be constant after vcc_expr_tostring.

Poul-Henning Kamp phk at phk.freebsd.dk
Thu May 10 09:43:59 CEST 2012


In message <1336479888-4745-2-git-send-email-martin at varnish-software.com>, Mart
in Blix Grydeland writes:


Also here: Please add a ticket + vtc test case to prevent regression.

>Avoids vcc errors from constructs like "std.log("Test: " + 1);"
>---
> lib/libvcl/vcc_expr.c |    4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
>diff --git a/lib/libvcl/vcc_expr.c b/lib/libvcl/vcc_expr.c
>index 30e63d9..19a455c 100644
>--- a/lib/libvcl/vcc_expr.c
>+++ b/lib/libvcl/vcc_expr.c
>@@ -434,8 +434,10 @@ vcc_expr_tostring(struct expr **e, enum var_type fmt)
> 	case TIME:	p = "VRT_time_string(sp, \v1)"; break;
> 	default:	break;
> 	}
>-	if (p != NULL)
>+	if (p != NULL) {
> 		*e = vcc_expr_edit(fmt, p, *e, NULL);
>+		(*e)->constant = 0;
>+	}
> }
> 
> /*--------------------------------------------------------------------
>-- 
>1.7.4.1
>
>
>_______________________________________________
>varnish-dev mailing list
>varnish-dev at varnish-cache.org
>https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list