[master] 6fe073a Don't acces symbol until we are sure we have one.

Poul-Henning Kamp phk at varnish-cache.org
Mon Mar 14 10:53:00 CET 2011


commit 6fe073aee49a1fe48b182e0cfffb0bfe27c6c684
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Mar 14 09:52:45 2011 +0000

    Don't acces symbol until we are sure we have one.

diff --git a/lib/libvcl/vcc_expr.c b/lib/libvcl/vcc_expr.c
index de2df31..952c2a7 100644
--- a/lib/libvcl/vcc_expr.c
+++ b/lib/libvcl/vcc_expr.c
@@ -579,7 +579,6 @@ vcc_Eval_Func(struct vcc *tl, struct expr **e, const struct symbol *sym)
 		} else if (fmt == HEADER) {
 			const struct var *v;
 			sym = VCC_FindSymbol(tl, tl->t, SYM_NONE);
-			vcc_AddUses(tl, tl->t, sym->r_methods, "Not available");
 			ERRCHK(tl);
 			SkipToken(tl, ID);
 			if (sym == NULL) {
@@ -587,6 +586,7 @@ vcc_Eval_Func(struct vcc *tl, struct expr **e, const struct symbol *sym)
 				vcc_ErrWhere(tl, tl->t);
 				return;
 			}
+			vcc_AddUses(tl, tl->t, sym->r_methods, "Not available");
 			if (sym->kind != SYM_VAR) {
 				vsb_printf(tl->sb, "Wrong kind of symbol.\n");
 				vcc_ErrWhere(tl, tl->t);



More information about the varnish-commit mailing list