Commit 9d0e486f authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Don't consider a vcc expr to be constant after vcc_expr_tostring.

Avoids vcc errors from constructs like "std.log("Test: " + 1);"

Fixes: #1134
parent 0352ea25
varnishtest "vcc const/non-const tostring conversion - bug 1134"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
set req.http.x-test = "Test " + 1;
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
} -run
......@@ -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;
}
}
/*--------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment