r5203 - trunk/varnish-cache/lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Tue Sep 14 09:50:29 CEST 2010


Author: phk
Date: 2010-09-14 09:50:29 +0200 (Tue, 14 Sep 2010)
New Revision: 5203

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_expr.c
Log:
Check symbol kind in expression processing and whine if unknown.



Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_expr.c	2010-09-14 07:45:32 UTC (rev 5202)
+++ trunk/varnish-cache/lib/libvcl/vcc_expr.c	2010-09-14 07:50:29 UTC (rev 5203)
@@ -538,7 +538,7 @@
 		}
 		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 @@
 			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:




More information about the varnish-commit mailing list