[master] 0e90b4c More symbol table simplification

Poul-Henning Kamp phk at FreeBSD.org
Mon Jan 29 23:21:10 UTC 2018


commit 0e90b4c702d88001488a92d27892aea2767fb0aa
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 29 22:40:38 2018 +0000

    More symbol table simplification

diff --git a/bin/varnishtest/tests/m00008.vtc b/bin/varnishtest/tests/m00008.vtc
index 849ba4e..7026f57 100644
--- a/bin/varnishtest/tests/m00008.vtc
+++ b/bin/varnishtest/tests/m00008.vtc
@@ -6,6 +6,10 @@ varnish v1 -errvcl {Module debug conflicts with other symbol.} {
 	backend b { .host = "127.0.0.1"; }
 	sub debug {}
 	import debug;
+
+	sub vcl_recv {
+		call debug;
+	}
 }
 
 server s1 {
diff --git a/bin/varnishtest/tests/v00018.vtc b/bin/varnishtest/tests/v00018.vtc
index 653c0a0..afba076 100644
--- a/bin/varnishtest/tests/v00018.vtc
+++ b/bin/varnishtest/tests/v00018.vtc
@@ -126,3 +126,9 @@ varnish v1 -errvcl {Not a valid action in method 'vcl_recv'} {
 		return (synth(503));
 	}
 }
+
+varnish v1 -errvcl {Not a VCL label:} {
+	sub vcl_recv {
+		return (vcl(vcl_recv));
+	}
+}
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 5378746..0472479 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -255,13 +255,9 @@ parse_return_vcl(struct vcc *tl)
 	ExpectErr(tl, '(');
 	vcc_NextToken(tl);
 	ExpectErr(tl, ID);
-	sym = VCC_SymbolTok(tl, SYM_VCL, 0);
+	sym = VCC_SymbolGet(tl, SYM_VCL, "Not a VCL label", XREF_NONE);
 	ERRCHK(tl);
-	if (sym == NULL) {
-		VSB_printf(tl->sb, "Not a VCL label:\n");
-		vcc_ErrWhere(tl, tl->t);
-		return;
-	}
+	AN(sym);
 	if (sym->eval_priv == NULL) {
 		VSB_printf(tl->fi, "%s VCL %s */\n", VCC_INFO_PREFIX,
 		    sym->name);


More information about the varnish-commit mailing list