Commit 10aabc36 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Check symbol kind in expression processing and whine if unknown.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5203 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent f6306e4e
......@@ -538,7 +538,7 @@ vcc_expr4(struct vcc *tl, struct expr **e, enum var_type fmt)
}
AN(sym);
if (sym->var != NULL) {
if (sym->kind == SYM_VAR) {
vcc_AddUses(tl, tl->t, sym->r_methods, "Not available");
vp = vcc_FindVar(tl, tl->t, 0, "cannot be read");
ERRCHK(tl);
......@@ -546,11 +546,15 @@ vcc_expr4(struct vcc *tl, struct expr **e, enum var_type fmt)
vsb_printf(e1->vsb, "%s", vp->rname);
e1->fmt = vp->fmt;
vcc_NextToken(tl);
} else if (sym->cfunc != NULL) {
} else if (sym->kind == SYM_FUNC) {
vcc_expr_call(tl, &e1, sym);
ERRCHK(tl);
*e = e1;
return;
} else {
vsb_printf(tl->sb, "Wrong kind of symbol.\n");
vcc_ErrWhere(tl, tl->t);
return;
}
break;
case CSTR:
......
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