[master] de316c119 gc duplicate check

Nils Goroll nils.goroll at uplex.de
Mon Dec 16 11:38:06 UTC 2019


commit de316c1192458984c1f9119835e3e1e548971866
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Dec 16 12:30:34 2019 +0100

    gc duplicate check
    
    we already check for unused subs in vcc_checkref()
    
    Fixes #3159

diff --git a/lib/libvcc/vcc_xref.c b/lib/libvcc/vcc_xref.c
index 271f787fd..415e9ce95 100644
--- a/lib/libvcc/vcc_xref.c
+++ b/lib/libvcc/vcc_xref.c
@@ -195,7 +195,7 @@ vcc_CheckActionRecurse(struct vcc *tl, struct proc *p, unsigned bitmap)
 /*--------------------------------------------------------------------*/
 
 static void
-vcc_checkaction1(struct vcc *tl, const struct symbol *sym)
+vcc_checkaction(struct vcc *tl, const struct symbol *sym)
 {
 	struct proc *p;
 
@@ -219,30 +219,11 @@ vcc_checkaction1(struct vcc *tl, const struct symbol *sym)
 
 }
 
-static void
-vcc_checkaction2(struct vcc *tl, const struct symbol *sym)
-{
-	struct proc *p;
-
-	p = sym->proc;
-	AN(p);
-
-	if (p->called)
-		return;
-	VSB_cat(tl->sb, "Function unused\n");
-	vcc_ErrWhere(tl, p->name);
-	if (!tl->err_unref)
-		vcc_Warn(tl);
-}
-
 int
 vcc_CheckAction(struct vcc *tl)
 {
 
-	VCC_WalkSymbols(tl, vcc_checkaction1, SYM_SUB);
-	if (tl->err)
-		return (tl->err);
-	VCC_WalkSymbols(tl, vcc_checkaction2, SYM_SUB);
+	VCC_WalkSymbols(tl, vcc_checkaction, SYM_SUB);
 	return (tl->err);
 }
 


More information about the varnish-commit mailing list