[master] 8535a3e Add asserts

Poul-Henning Kamp phk at FreeBSD.org
Mon Sep 8 15:18:30 CEST 2014


commit 8535a3ed28ba58b97117cd4cf04fd54a18ebed00
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Sep 8 12:13:46 2014 +0000

    Add asserts

diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index b8ee0b9..fda8cb6 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -129,6 +129,8 @@ VFP_Open(struct vfp_ctx *vc)
 	struct vfp_entry *vfe;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
+	CHECK_OBJ_NOTNULL(vc->http, HTTP_MAGIC);
+	AN(vc->vsl);
 	VTAILQ_FOREACH_REVERSE(vfe, &vc->vfp, vfp_entry_s, list) {
 		if (vfe->vfp->init == NULL)
 			continue;
@@ -188,6 +190,7 @@ VFP_Push(struct vfp_ctx *vc, const struct vfp *vfp, int top)
 	struct vfp_entry *vfe;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
+	CHECK_OBJ_NOTNULL(vc->http, HTTP_MAGIC);
 	vfe = (void*)WS_Alloc(vc->http->ws, sizeof *vfe);
 	AN(vfe);
 	vfe->magic = VFP_ENTRY_MAGIC;
diff --git a/bin/varnishd/cache/cache_shmlog.c b/bin/varnishd/cache/cache_shmlog.c
index 74b11d7..66d7c89 100644
--- a/bin/varnishd/cache/cache_shmlog.c
+++ b/bin/varnishd/cache/cache_shmlog.c
@@ -303,6 +303,7 @@ VSLbv(struct vsl_log *vsl, enum VSL_tag_e tag, const char *fmt, va_list ap)
 	unsigned n, mlen;
 	txt t;
 
+	AN(vsl);
 	AN(fmt);
 	if (vsl_tag_is_masked(tag))
 		return;



More information about the varnish-commit mailing list