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
0fc4e8c7
Commit
0fc4e8c7
authored
Jan 29, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More symbol simplification
parent
7d31e25a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
30 deletions
+14
-30
m00001.vtc
bin/varnishtest/tests/m00001.vtc
+1
-1
r00916.vtc
bin/varnishtest/tests/r00916.vtc
+1
-1
v00016.vtc
bin/varnishtest/tests/v00016.vtc
+2
-2
v00018.vtc
bin/varnishtest/tests/v00018.vtc
+2
-2
v00020.vtc
bin/varnishtest/tests/v00020.vtc
+2
-2
vcc_compile.h
lib/libvcc/vcc_compile.h
+0
-1
vcc_expr.c
lib/libvcc/vcc_expr.c
+3
-19
vcc_symb.c
lib/libvcc/vcc_symb.c
+2
-2
vcc_xref.c
lib/libvcc/vcc_xref.c
+1
-0
No files found.
bin/varnishtest/tests/m00001.vtc
View file @
0fc4e8c7
...
...
@@ -52,7 +52,7 @@ varnish v1 -errvcl {Module std already imported.} {
import std;
}
varnish v1 -errvcl {Symbol
not found: 'std' (expected type BOOL):
} {
varnish v1 -errvcl {Symbol
type (vmod) can not be used in expression.
} {
import std;
sub vcl_recv {
...
...
bin/varnishtest/tests/r00916.vtc
View file @
0fc4e8c7
...
...
@@ -5,7 +5,7 @@ server s1 {
txresp -body "FOO"
} -start
varnish v1 -errvcl {Symbol not found: 's-1'
(expected type BACKEND):
} {
varnish v1 -errvcl {Symbol not found: 's-1'} {
backend b { .host = "127.0.0.1"; }
sub s1 {
}
...
...
bin/varnishtest/tests/v00016.vtc
View file @
0fc4e8c7
...
...
@@ -41,7 +41,7 @@ varnish v1 -errvcl {Operator > not possible on BACKEND} {
sub vcl_recv { if (a > b) { } }
}
varnish v1 -errvcl {Symbol not found: 'req.foo'
(expected type BOOL):
} {
varnish v1 -errvcl {Symbol not found: 'req.foo'} {
backend b { .host = "127.0.0.1"; }
sub vcl_hash { if (req.foo != "bar") { } }
}
...
...
@@ -66,7 +66,7 @@ varnish v1 -errvcl {Cannot be set in method 'vcl_pipe'.} {
}
}
varnish v1 -errvcl {Symbol not found: 'c'
(expected type BACKEND):
} {
varnish v1 -errvcl {Symbol not found: 'c'} {
backend b { .host = "127.0.0.1"; }
sub vcl_backend_response {
if (beresp.backend == c) {
...
...
bin/varnishtest/tests/v00018.vtc
View file @
0fc4e8c7
...
...
@@ -38,7 +38,7 @@ varnish v1 -errvcl {Expected ';' got 'if'} {
sub vcl_recv { set req.url = "foo" if "bar"; }
}
varnish v1 -errvcl {Symbol not found: 'req.foo'
(expected type STRING):
} {
varnish v1 -errvcl {Symbol not found: 'req.foo'} {
backend b { .host = "127.0.0.1"; }
sub vcl_hash { hash_data(req.foo); }
}
...
...
@@ -63,7 +63,7 @@ varnish v1 -vcl {
sub vcl_backend_response { set beresp.do_gzip = false; }
}
varnish v1 -errvcl {Symbol not found: 'mu'
(expected type BOOL):
} {
varnish v1 -errvcl {Symbol not found: 'mu'} {
backend b { .host = "127.0.0.1"; }
sub vcl_backend_response { set beresp.do_gzip = mu; }
}
...
...
bin/varnishtest/tests/v00020.vtc
View file @
0fc4e8c7
...
...
@@ -31,7 +31,7 @@ varnish v1 -errvcl {Comparison of different types: INT '!=' STRING} {
}
}
varnish v1 -errvcl {Symbol
not found: 'vcl_recv' (expected type STRING)
} {
varnish v1 -errvcl {Symbol
type (sub) can not be used in expression.
} {
sub vcl_recv {
set req.http.foo = vcl_recv;
}
...
...
@@ -262,7 +262,7 @@ varnish v1 -errvcl {INT * BLOB not possible.} {
}
# XXX: should spot nonexistent storage
varnish v1 -errvcl {Symbol not found: 'storage.foo'
(expected type STEVEDORE):
} {
varnish v1 -errvcl {Symbol not found: 'storage.foo'} {
sub vcl_backend_response {
set beresp.storage = storage.foo;
}
...
...
lib/libvcc/vcc_compile.h
View file @
0fc4e8c7
...
...
@@ -281,7 +281,6 @@ sym_expr_t vcc_Eval_Handle;
sym_expr_t
vcc_Eval_SymFunc
;
void
vcc_Eval_Func
(
struct
vcc
*
tl
,
const
char
*
spec
,
const
char
*
extra
,
const
struct
symbol
*
sym
);
enum
symkind
VCC_HandleKind
(
vcc_type_t
fmt
);
void
VCC_GlobalSymbol
(
struct
symbol
*
,
vcc_type_t
fmt
,
const
char
*
pfx
);
struct
symbol
*
VCC_HandleSymbol
(
struct
vcc
*
,
vcc_type_t
,
const
char
*
);
...
...
lib/libvcc/vcc_expr.c
View file @
0fc4e8c7
...
...
@@ -630,7 +630,6 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
struct
expr
*
e1
,
*
e2
;
const
char
*
ip
,
*
sign
;
struct
symbol
*
sym
;
enum
symkind
kind
;
double
d
;
int
i
;
...
...
@@ -649,24 +648,9 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
}
switch
(
tl
->
t
->
tok
)
{
case
ID
:
/*
* XXX: what if var and func/proc had same name ?
* XXX: look for SYM_VAR first for consistency ?
*/
sym
=
NULL
;
kind
=
VCC_HandleKind
(
fmt
);
if
(
kind
!=
SYM_NONE
)
sym
=
VCC_SymbolTok
(
tl
,
kind
,
0
);
if
(
sym
==
NULL
)
sym
=
VCC_SymbolTok
(
tl
,
SYM_NONE
,
0
);
if
(
sym
==
NULL
||
sym
->
eval
==
NULL
)
{
VSB_printf
(
tl
->
sb
,
"Symbol not found: "
);
vcc_ErrToken
(
tl
,
tl
->
t
);
VSB_printf
(
tl
->
sb
,
" (expected type %s):
\n
"
,
vcc_utype
(
fmt
));
vcc_ErrWhere
(
tl
,
tl
->
t
);
return
;
}
sym
=
VCC_SymbolGet
(
tl
,
SYM_NONE
,
"Symbol not found"
,
XREF_NONE
);
ERRCHK
(
tl
);
AN
(
sym
);
if
(
sym
->
kind
==
SYM_FUNC
&&
sym
->
fmt
==
VOID
)
{
VSB_printf
(
tl
->
sb
,
"Function returns VOID:
\n
"
);
...
...
lib/libvcc/vcc_symb.c
View file @
0fc4e8c7
...
...
@@ -39,7 +39,7 @@
/*--------------------------------------------------------------------*/
enum
symkind
static
enum
symkind
VCC_HandleKind
(
vcc_type_t
fmt
)
{
if
(
fmt
==
ACL
)
return
(
SYM_ACL
);
...
...
@@ -111,7 +111,7 @@ VCC_SymbolGet(struct vcc *tl, enum symkind kind, const char *err,
struct
symbol
*
sym
;
sym
=
VCC_Symbol
(
tl
,
NULL
,
tl
->
t
->
b
,
tl
->
t
->
e
,
kind
,
err
==
NULL
);
if
(
sym
==
NULL
||
sym
->
kind
!=
kind
)
{
if
(
sym
==
NULL
||
(
kind
!=
SYM_NONE
&&
sym
->
kind
!=
kind
)
)
{
VSB_printf
(
tl
->
sb
,
"%s: "
,
err
);
vcc_ErrToken
(
tl
,
tl
->
t
);
VSB_cat
(
tl
->
sb
,
"
\n
At: "
);
...
...
lib/libvcc/vcc_xref.c
View file @
0fc4e8c7
...
...
@@ -67,6 +67,7 @@ void
vcc_AddRef
(
struct
vcc
*
tl
,
struct
symbol
*
sym
)
{
(
void
)
tl
;
if
(
sym
->
ref_b
==
NULL
)
sym
->
ref_b
=
tl
->
t
;
sym
->
nref
++
;
...
...
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