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
60b5e71e
Commit
60b5e71e
authored
May 26, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly complain if people try to reuse symbols.
Fixes #1510
parent
38ee7837
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
r01510.vtc
bin/varnishtest/tests/r01510.vtc
+19
-0
vcc_action.c
lib/libvcc/vcc_action.c
+16
-0
No files found.
bin/varnishtest/tests/r01510.vtc
0 → 100644
View file @
60b5e71e
varnishtest "Duplicate object names"
varnish v1 -errvcl {Object name 'first' already used.} {
import ${vmod_debug};
sub vcl_init {
new first = debug.obj("FOO");
new first = debug.obj("BAH");
}
}
varnish v1 -errvcl {Object name 'first' already used.} {
import ${vmod_debug};
backend first { .host = "${bad_ip}"; }
sub vcl_init {
new first = debug.obj("FOO");
}
}
lib/libvcc/vcc_action.c
View file @
60b5e71e
...
...
@@ -164,10 +164,25 @@ parse_new(struct vcc *tl)
return
;
}
sy1
=
VCC_FindSymbol
(
tl
,
tl
->
t
,
SYM_NONE
);
if
(
sy1
!=
NULL
)
{
VSB_printf
(
tl
->
sb
,
"Object name '%.*s' already used.
\n
"
,
PF
(
tl
->
t
));
VSB_printf
(
tl
->
sb
,
"First usage:
\n
"
);
AN
(
sy1
->
def_b
);
if
(
sy1
->
def_e
!=
NULL
)
vcc_ErrWhere2
(
tl
,
sy1
->
def_b
,
sy1
->
def_e
);
else
vcc_ErrWhere
(
tl
,
sy1
->
def_b
);
VSB_printf
(
tl
->
sb
,
"Redefinition:
\n
"
);
vcc_ErrWhere
(
tl
,
tl
->
t
);
return
;
}
XXXAZ
(
sy1
);
sy1
=
VCC_AddSymbolTok
(
tl
,
tl
->
t
,
SYM_NONE
);
// XXX: NONE ?
XXXAN
(
sy1
);
sy1
->
def_b
=
tl
->
t
;
vcc_NextToken
(
tl
);
ExpectErr
(
tl
,
'='
);
...
...
@@ -243,6 +258,7 @@ parse_new(struct vcc *tl)
}
p
+=
2
;
}
sy1
->
def_e
=
tl
->
t
;
/*lint -restore */
}
...
...
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