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
f4f41c51
Commit
f4f41c51
authored
May 17, 2019
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use vmod symbol instead of vmod name
parent
f0cba1de
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
+19
-15
vcc_compile.h
lib/libvcc/vcc_compile.h
+3
-2
vcc_expr.c
lib/libvcc/vcc_expr.c
+11
-9
vcc_symb.c
lib/libvcc/vcc_symb.c
+1
-1
vcc_vmod.c
lib/libvcc/vcc_vmod.c
+4
-3
No files found.
lib/libvcc/vcc_compile.h
View file @
f4f41c51
...
...
@@ -144,7 +144,7 @@ struct symbol {
int
hirev
;
struct
symbol
*
parent
;
const
char
*
vmod
;
const
struct
symbol
*
vmod
;
sym_wildcard_t
*
wildcard
;
vcc_kind_t
kind
;
...
...
@@ -356,7 +356,8 @@ extern const char SYMTAB_NOERR[];
extern
const
char
SYMTAB_CREATE
[];
struct
symbol
*
VCC_SymbolGet
(
struct
vcc
*
,
vcc_kind_t
,
const
char
*
,
const
char
*
);
struct
symbol
*
VCC_SymbolGetTok
(
struct
vcc
*
,
vcc_kind_t
,
const
char
*
,
const
char
*
,
struct
token
*
);
struct
symbol
*
VCC_SymbolGetTok
(
struct
vcc
*
,
vcc_kind_t
,
const
char
*
,
const
char
*
,
const
struct
token
*
);
typedef
void
symwalk_f
(
struct
vcc
*
tl
,
const
struct
symbol
*
s
);
void
VCC_WalkSymbols
(
struct
vcc
*
tl
,
symwalk_f
*
func
,
vcc_kind_t
);
...
...
lib/libvcc/vcc_expr.c
View file @
f4f41c51
...
...
@@ -355,22 +355,24 @@ vcc_priv_arg(struct vcc *tl, const char *p, const struct symbol *sym)
{
char
buf
[
64
];
struct
inifin
*
ifp
;
const
char
*
vmod
,
*
f
=
NULL
;
const
char
*
f
=
NULL
;
struct
procprivhead
*
marklist
=
NULL
;
AN
(
sym
);
AN
(
sym
->
vmod
);
vmod
=
sym
->
vmod
;
if
(
!
strcmp
(
p
,
"PRIV_VCL"
))
{
return
(
vcc_mk_expr
(
VOID
,
"&vmod_priv_%s"
,
vmod
));
}
else
if
(
!
strcmp
(
p
,
"PRIV_CALL"
))
{
if
(
!
strcmp
(
p
,
"PRIV_VCL"
))
return
(
vcc_mk_expr
(
VOID
,
"&vmod_priv_%s"
,
sym
->
vmod
->
name
));
if
(
!
strcmp
(
p
,
"PRIV_CALL"
))
{
bprintf
(
buf
,
"vmod_priv_%u"
,
tl
->
unique
++
);
ifp
=
New_IniFin
(
tl
);
Fh
(
tl
,
0
,
"static struct vmod_priv %s;
\n
"
,
buf
);
VSB_printf
(
ifp
->
fin
,
"
\t
VRT_priv_fini(&%s);"
,
buf
);
return
(
vcc_mk_expr
(
VOID
,
"&%s"
,
buf
));
}
else
if
(
!
strcmp
(
p
,
"PRIV_TASK"
))
{
}
if
(
!
strcmp
(
p
,
"PRIV_TASK"
))
{
f
=
"task"
;
marklist
=
&
tl
->
curproc
->
priv_tasks
;
}
else
if
(
!
strcmp
(
p
,
"PRIV_TOP"
))
{
...
...
@@ -381,9 +383,9 @@ vcc_priv_arg(struct vcc *tl, const char *p, const struct symbol *sym)
}
AN
(
f
);
AN
(
marklist
);
bprintf
(
buf
,
"ARG_priv_%s_%s"
,
f
,
vmod
);
bprintf
(
buf
,
"ARG_priv_%s_%s"
,
f
,
sym
->
vmod
->
name
);
if
(
vcc_MarkPriv
(
tl
,
marklist
,
vmod
)
==
NULL
)
if
(
vcc_MarkPriv
(
tl
,
marklist
,
sym
->
vmod
->
name
)
==
NULL
)
VSB_printf
(
tl
->
curproc
->
prologue
,
" struct vmod_priv *%s = "
"VRT_priv_%s(ctx, &VGC_vmod_%s);
\n
"
...
...
@@ -392,7 +394,7 @@ vcc_priv_arg(struct vcc *tl, const char *p, const struct symbol *sym)
"for vmod %s
\"
);
\n
"
" return;
\n
"
" }
\n
"
,
buf
,
f
,
vmod
,
buf
,
f
,
vmod
);
buf
,
f
,
sym
->
vmod
->
name
,
buf
,
f
,
sym
->
vmod
->
name
);
return
(
vcc_mk_expr
(
VOID
,
"%s"
,
buf
));
}
...
...
lib/libvcc/vcc_symb.c
View file @
f4f41c51
...
...
@@ -199,7 +199,7 @@ const char SYMTAB_CREATE[] = "sym_create";
struct
symbol
*
VCC_SymbolGetTok
(
struct
vcc
*
tl
,
vcc_kind_t
kind
,
const
char
*
e
,
const
char
*
x
,
struct
token
*
t
)
const
struct
token
*
t
)
{
struct
symbol
*
sym
;
...
...
lib/libvcc/vcc_vmod.c
View file @
f4f41c51
...
...
@@ -57,7 +57,8 @@ vcc_path_dlopen(void *priv, const char *fn)
}
static
void
func_sym
(
struct
symbol
*
sym
,
const
char
*
vmod
,
const
struct
vjsn_val
*
v
)
func_sym
(
struct
symbol
*
sym
,
const
struct
symbol
*
vmod
,
const
struct
vjsn_val
*
v
)
{
assert
(
v
->
type
==
VJSN_ARRAY
);
...
...
@@ -139,13 +140,13 @@ vcc_json_wildcard(struct vcc *tl, struct symbol *msym, struct symbol *tsym)
!
strcmp
(
vv2
->
value
,
tsym
->
name
))
{
tsym
->
kind
=
SYM_FUNC
;
tsym
->
noref
=
1
;
func_sym
(
tsym
,
msym
->
name
,
VTAILQ_NEXT
(
vv2
,
list
));
func_sym
(
tsym
,
msym
,
VTAILQ_NEXT
(
vv2
,
list
));
return
;
}
else
if
(
!
strcmp
(
vv1
->
value
,
"$OBJ"
)
&&
!
strcmp
(
vv2
->
value
,
tsym
->
name
))
{
tsym
->
kind
=
SYM_OBJECT
;
tsym
->
eval_priv
=
vv2
;
tsym
->
vmod
=
msym
->
name
;
tsym
->
vmod
=
msym
;
return
;
}
}
...
...
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