[master] 8d673ea Make error messages in vmod function arguments less confusing.

Poul-Henning Kamp phk at FreeBSD.org
Mon Nov 6 07:41:08 UTC 2017


commit 8d673ea9de68e769c95b6d084f8ecdfacb3265c4
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Nov 2 22:17:22 2017 +0000

    Make error messages in vmod function arguments less confusing.

diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index 52159cb..17636da 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -716,12 +716,9 @@ vcc_Eval_Func(struct vcc *tl, const char *spec,
 
 	t1 = tl->t;
 	vcc_func(tl, &e, spec, extra, sym);
-	if (!tl->err) {
-		vcc_expr_fmt(tl->fb, tl->indent, e);
-		VSB_cat(tl->fb, ";\n");
-	} else if (t1 != tl->t) {
-		vcc_ErrWhere2(tl, t1, tl->t);
-	}
+	ERRCHK(tl);
+	vcc_expr_fmt(tl->fb, tl->indent, e);
+	VSB_cat(tl->fb, ";\n");
 	vcc_delete_expr(e);
 }
 
diff --git a/lib/libvcc/vcc_vmod.c b/lib/libvcc/vcc_vmod.c
index 30a4ae0..92d63fd 100644
--- a/lib/libvcc/vcc_vmod.c
+++ b/lib/libvcc/vcc_vmod.c
@@ -310,6 +310,7 @@ vcc_ParseNew(struct vcc *tl)
 
 	bprintf(buf1, ", &%s, \"%s\"", sy1->rname, sy1->name);
 	vcc_Eval_Func(tl, p, buf1, sy2);
+	ERRCHK(tl);
 	ExpectErr(tl, ';');
 
 	while (p[0] != '\0' || p[1] != '\0' || p[2] != '\0')


More information about the varnish-commit mailing list