Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
3a3aa942
Commit
3a3aa942
authored
Dec 07, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow symbols to be defined after use, provided their use gives
them a clear type. Fixes #2016
parent
ec59b44e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
c00005.vtc
bin/varnishtest/tests/c00005.vtc
+5
-4
vcc_symb.c
lib/libvcc/vcc_symb.c
+3
-2
No files found.
bin/varnishtest/tests/c00005.vtc
View file @
3a3aa942
...
@@ -10,15 +10,16 @@ server s1 {
...
@@ -10,15 +10,16 @@ server s1 {
} -start
} -start
varnish v1 -arg "-p vsl_mask=+VCL_trace" -vcl+backend {
varnish v1 -arg "-p vsl_mask=+VCL_trace" -vcl+backend {
acl acl1 {
"${localhost}";
}
sub vcl_recv {
sub vcl_recv {
if (client.ip ~ acl1) {
if (client.ip ~ acl1) {
set req.url = "/";
set req.url = "/";
}
}
}
}
acl acl1 {
"${localhost}";
}
sub vcl_deliver {
sub vcl_deliver {
set resp.http.acl = acl1;
set resp.http.acl = acl1;
}
}
...
...
lib/libvcc/vcc_symb.c
View file @
3a3aa942
...
@@ -235,13 +235,14 @@ VCC_HandleSymbol(struct vcc *tl, const struct token *tk, vcc_type_t fmt,
...
@@ -235,13 +235,14 @@ VCC_HandleSymbol(struct vcc *tl, const struct token *tk, vcc_type_t fmt,
AN
(
sym
->
def_b
);
AN
(
sym
->
def_b
);
vcc_ErrWhere
(
tl
,
sym
->
def_b
);
vcc_ErrWhere
(
tl
,
sym
->
def_b
);
return
(
sym
);
return
(
sym
);
}
else
if
(
sym
!=
NULL
)
{
}
else
if
(
sym
!=
NULL
&&
sym
->
kind
!=
kind
)
{
VSB_printf
(
tl
->
sb
,
VSB_printf
(
tl
->
sb
,
"Name %.*s is a reserved name.
\n
"
,
PF
(
tk
));
"Name %.*s is a reserved name.
\n
"
,
PF
(
tk
));
vcc_ErrWhere
(
tl
,
tk
);
vcc_ErrWhere
(
tl
,
tk
);
return
(
sym
);
return
(
sym
);
}
}
sym
=
VCC_SymbolTok
(
tl
,
NULL
,
tk
,
kind
,
1
);
if
(
sym
==
NULL
)
sym
=
VCC_SymbolTok
(
tl
,
NULL
,
tk
,
kind
,
1
);
AN
(
sym
);
AN
(
sym
);
AZ
(
sym
->
ndef
);
AZ
(
sym
->
ndef
);
va_start
(
ap
,
str
);
va_start
(
ap
,
str
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment