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
99629965
Commit
99629965
authored
Aug 27, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an issue where the order of symbol definition determined if
code could compile or not. Fixes #1569
parent
5a83b69d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
r01569.vtc
bin/varnishtest/tests/r01569.vtc
+19
-0
vcc_expr.c
lib/libvcc/vcc_expr.c
+9
-1
vcc_symb.c
lib/libvcc/vcc_symb.c
+0
-1
No files found.
bin/varnishtest/tests/r01569.vtc
0 → 100644
View file @
99629965
varnishtest "symbol lookup order issue"
varnish v1 -vcl {
vcl 4.0;
import ${vmod_debug};
backend debug {
.host = "127.0.0.1";
.port = "80";
}
sub debug {
set req.backend_hint = debug;
}
sub vcl_recv {
call debug;
}
}
lib/libvcc/vcc_expr.c
View file @
99629965
...
@@ -688,7 +688,15 @@ vcc_expr4(struct vcc *tl, struct expr **e, enum var_type fmt)
...
@@ -688,7 +688,15 @@ vcc_expr4(struct vcc *tl, struct expr **e, enum var_type fmt)
* XXX: what if var and func/proc had same name ?
* XXX: what if var and func/proc had same name ?
* XXX: look for SYM_VAR first for consistency ?
* XXX: look for SYM_VAR first for consistency ?
*/
*/
sym
=
VCC_FindSymbol
(
tl
,
tl
->
t
,
SYM_NONE
);
sym
=
NULL
;
if
(
fmt
==
BACKEND
)
sym
=
VCC_FindSymbol
(
tl
,
tl
->
t
,
SYM_BACKEND
);
if
(
sym
==
NULL
)
sym
=
VCC_FindSymbol
(
tl
,
tl
->
t
,
SYM_VAR
);
if
(
sym
==
NULL
)
sym
=
VCC_FindSymbol
(
tl
,
tl
->
t
,
SYM_FUNC
);
if
(
sym
==
NULL
)
sym
=
VCC_FindSymbol
(
tl
,
tl
->
t
,
SYM_NONE
);
if
(
sym
==
NULL
||
sym
->
eval
==
NULL
)
{
if
(
sym
==
NULL
||
sym
->
eval
==
NULL
)
{
VSB_printf
(
tl
->
sb
,
"Symbol not found: "
);
VSB_printf
(
tl
->
sb
,
"Symbol not found: "
);
vcc_ErrToken
(
tl
,
tl
->
t
);
vcc_ErrToken
(
tl
,
tl
->
t
);
...
...
lib/libvcc/vcc_symb.c
View file @
99629965
...
@@ -50,7 +50,6 @@ VCC_SymKind(struct vcc *tl, const struct symbol *s)
...
@@ -50,7 +50,6 @@ VCC_SymKind(struct vcc *tl, const struct symbol *s)
}
}
}
}
static
struct
symbol
*
static
struct
symbol
*
vcc_AddSymbol
(
struct
vcc
*
tl
,
const
char
*
nb
,
int
l
,
enum
symkind
kind
)
vcc_AddSymbol
(
struct
vcc
*
tl
,
const
char
*
nb
,
int
l
,
enum
symkind
kind
)
{
{
...
...
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