Mailing List Archive

[master] edee8c62e Ensure VCL instance actions imply method calls
commit edee8c62e2c262e8b266ac82d94d86d9f461d314
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Sun Dec 1 10:10:43 2019 +0100

Ensure VCL instance actions imply method calls

diff --git a/bin/varnishtest/tests/v00018.vtc b/bin/varnishtest/tests/v00018.vtc
index 32583760b..d2728bcaf 100644
--- a/bin/varnishtest/tests/v00018.vtc
+++ b/bin/varnishtest/tests/v00018.vtc
@@ -147,3 +147,11 @@ varnish v1 -errvcl {Syntax error} {
directors.round_robin.backend();
}
}
+
+varnish v1 -errvcl {Expected '.' got ';'} {
+ import directors;
+ sub vcl_init {
+ new rr = directors.round_robin();
+ rr;
+ }
+}
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index 02e67d92d..67623e0b2 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -1431,6 +1431,7 @@ vcc_Act_Obj(struct vcc *tl, struct token *t, struct symbol *sym)
struct expr *e = NULL;

assert(sym->kind == SYM_INSTANCE);
+ ExpectErr(tl, '.');
tl->t = t;
vcc_expr4(tl, &e, sym->type);
ERRCHK(tl);
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit