vcc: Add missing ERRCHK to vcc_expr5()

VCC_SymbolGet() could fail, e,g, if the token is reserved

Now with vtc to make the issue more obvious.

OKed by Dridi via IRC

Ref cf396384
parent 3730f544
......@@ -42,6 +42,14 @@ varnish v1 -errvcl {Symbol 'acl' type (reserved) can not be used in expression.}
sub vcl_recv { call acl; }
}
varnish v1 -errvcl {Symbols named 'vcl_*' are reserved.} {
import debug;
sub vcl_recv {
debug.test_probe(vcl_sub1, vcl_sub2);
}
}
varnish v1 -errvcl {Operator * not possible on type STRING.} {
sub vcl_recv {
set req.http.foo = "bla" * "foo";
......
......@@ -745,6 +745,7 @@ vcc_expr5(struct vcc *tl, struct expr **e, vcc_type_t fmt)
if (sym == NULL && fmt->global_pfx != NULL && t1->tok != '.') {
sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE,
SYMTAB_CREATE, XREF_REF);
ERRCHK(tl);
AN(sym);
VCC_GlobalSymbol(sym, fmt);
}
......
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