Commit 4b48f886 authored by Nils Goroll's avatar Nils Goroll

vcc: return no symbol when types don't match

When we are looking for ! SYM_NONE and find ! SYM_NONE, do not
return the symbol we found.

The semantics of (kind != SYM_NONE && sym->kind != kind) are
inclusive because the next conditional is not true for this case.

Ref: 9d81a71a

Fixes: #2497
parent fa388439
......@@ -88,3 +88,17 @@ varnish v1 -errvcl {resolves to too many addresses} {
if (remote.ip == "varnish-cache.org") {}
}
}
varnish v1 -errvcl {Undefined acl foo} {
import directors;
backend b { .host = "127.0.0.1"; }
sub vcl_init {
new foo = directors.shard();
}
sub vcl_recv {
if (client.ip ~ foo) {
return (synth(200));
}
}
}
......@@ -146,8 +146,9 @@ VCC_Symbol(struct vcc *tl, struct symbol *parent,
continue;
if (q < e)
break;
if (kind != SYM_NONE && sym->kind != kind)
break;
if (kind != SYM_NONE && sym->kind != SYM_NONE &&
kind != sym->kind)
sym = NULL;
if (kind == SYM_NONE && sym->kind == kind)
continue;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment