[master] f70bcbc Make sure the step numbes are decreasing

Guillaume Quintard guillaume at varnish-software.com
Thu Sep 8 14:14:12 CEST 2016


commit f70bcbc490121e21b227330ebb2a19cd477bb10c
Author: Guillaume Quintard <guillaume at varnish-software.com>
Date:   Thu Sep 8 12:57:00 2016 +0200

    Make sure the step numbes are decreasing
    
    Thanks @nigoroll for the suggestion.

diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index 86e69e5..3ebc651 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -286,7 +286,7 @@ EmitCoordinates(const struct vcc *tl, struct vsb *vsb)
 static void
 EmitInitFini(const struct vcc *tl)
 {
-	struct inifin *p;
+	struct inifin *p, *q = NULL;
 	unsigned has_event = 0;
 
 	Fh(tl, 0, "\n");
@@ -325,6 +325,8 @@ EmitInitFini(const struct vcc *tl)
 	Fc(tl, 0, "\tswitch (vgc_inistep) {\n\n");
 	VTAILQ_FOREACH_REVERSE(p, &tl->inifin, inifinhead, list) {
 		AZ(VSB_finish(p->fin));
+		if (q)
+			assert(q->n > p->n);
 		if (VSB_len(p->fin)) {
 			Fc(tl, 0, "\t\tcase %u :\n", p->n);
 			Fc(tl, 0, "\t%s\n", VSB_data(p->fin));



More information about the varnish-commit mailing list