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
b3484a49
Commit
b3484a49
authored
May 23, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch redefinition of non-method sub's early.
parent
1a5b7fd0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
v00034.vtc
bin/varnishtest/tests/v00034.vtc
+15
-0
vcc_compile.h
lib/libvcl/vcc_compile.h
+1
-1
vcc_parse.c
lib/libvcl/vcc_parse.c
+8
-2
vcc_xref.c
lib/libvcl/vcc_xref.c
+2
-1
No files found.
bin/varnishtest/tests/v00034.vtc
0 → 100644
View file @
b3484a49
varnishtest "Test sub redefinition"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend { } -start
varnish v1 -badvcl {
backend foo { .host = "127.0.0.1"; }
sub c1 { }
sub c1 { }
sub vcl_recv { call c1; }
}
lib/libvcl/vcc_compile.h
View file @
b3484a49
...
...
@@ -310,7 +310,7 @@ void vcc_VarVal(struct vcc *tl, const struct var *vp,
void
vcc_ParseImport
(
struct
vcc
*
tl
);
/* vcc_xref.c */
void
vcc_AddDef
(
struct
vcc
*
tl
,
const
struct
token
*
t
,
enum
symkind
type
);
int
vcc_AddDef
(
struct
vcc
*
tl
,
const
struct
token
*
t
,
enum
symkind
type
);
void
vcc_AddRef
(
struct
vcc
*
tl
,
const
struct
token
*
t
,
enum
symkind
type
);
int
vcc_CheckReferences
(
struct
vcc
*
tl
);
...
...
lib/libvcl/vcc_parse.c
View file @
b3484a49
...
...
@@ -194,7 +194,7 @@ vcc_Compound(struct vcc *tl)
static
void
vcc_Function
(
struct
vcc
*
tl
)
{
int
m
;
int
m
,
i
;
vcc_NextToken
(
tl
);
ExpectErr
(
tl
,
ID
);
...
...
@@ -214,7 +214,13 @@ vcc_Function(struct vcc *tl)
Fb
(
tl
,
0
,
" */
\n
"
);
}
else
{
tl
->
fb
=
tl
->
fc
;
vcc_AddDef
(
tl
,
tl
->
t
,
SYM_SUB
);
i
=
vcc_AddDef
(
tl
,
tl
->
t
,
SYM_SUB
);
if
(
i
>
1
)
{
vsb_printf
(
tl
->
sb
,
"Function %.*s redefined
\n
"
,
PF
(
tl
->
t
));
vcc_ErrWhere
(
tl
,
tl
->
t
);
return
;
}
tl
->
curproc
=
vcc_AddProc
(
tl
,
tl
->
t
);
Fh
(
tl
,
0
,
"static int VGC_function_%.*s (struct sess *sp);
\n
"
,
PF
(
tl
->
t
));
...
...
lib/libvcl/vcc_xref.c
View file @
b3484a49
...
...
@@ -87,7 +87,7 @@ vcc_AddRef(struct vcc *tl, const struct token *t, enum symkind kind)
sym
->
nref
++
;
}
void
int
vcc_AddDef
(
struct
vcc
*
tl
,
const
struct
token
*
t
,
enum
symkind
kind
)
{
struct
symbol
*
sym
;
...
...
@@ -95,6 +95,7 @@ vcc_AddDef(struct vcc *tl, const struct token *t, enum symkind kind)
sym
=
VCC_GetSymbolTok
(
tl
,
t
,
kind
);
AN
(
sym
);
sym
->
ndef
++
;
return
(
sym
->
ndef
);
}
/*--------------------------------------------------------------------*/
...
...
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