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
37fc9699
Commit
37fc9699
authored
Jan 03, 2019
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve function call argument error messages.
Fixes: #2874
parent
0d5da11f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
vcc_expr.c
lib/libvcc/vcc_expr.c
+12
-0
No files found.
lib/libvcc/vcc_expr.c
View file @
37fc9699
...
@@ -576,6 +576,10 @@ vcc_func(struct vcc *tl, struct expr **e, const void *priv,
...
@@ -576,6 +576,10 @@ vcc_func(struct vcc *tl, struct expr **e, const void *priv,
break
;
break
;
}
}
vcc_do_arg
(
tl
,
fa
);
vcc_do_arg
(
tl
,
fa
);
if
(
tl
->
err
)
VSB_printf
(
tl
->
sb
,
"Expected argument: %s %s
\n\n
"
,
fa
->
type
->
name
,
fa
->
name
?
fa
->
name
:
"(unnamed argument)"
);
ERRCHK
(
tl
);
ERRCHK
(
tl
);
if
(
tl
->
t
->
tok
==
')'
)
if
(
tl
->
t
->
tok
==
')'
)
break
;
break
;
...
@@ -666,6 +670,8 @@ vcc_Eval_Func(struct vcc *tl, const struct vjsn_val *spec,
...
@@ -666,6 +670,8 @@ vcc_Eval_Func(struct vcc *tl, const struct vjsn_val *spec,
struct
expr
*
e
=
NULL
;
struct
expr
*
e
=
NULL
;
vcc_func
(
tl
,
&
e
,
spec
,
extra
,
sym
);
vcc_func
(
tl
,
&
e
,
spec
,
extra
,
sym
);
if
(
tl
->
err
)
VSB_printf
(
tl
->
sb
,
"While compiling function call:
\n
"
);
ERRCHK
(
tl
);
ERRCHK
(
tl
);
vcc_expr_fmt
(
tl
->
fb
,
tl
->
indent
,
e
);
vcc_expr_fmt
(
tl
->
fb
,
tl
->
indent
,
e
);
VSB_cat
(
tl
->
fb
,
";
\n
"
);
VSB_cat
(
tl
->
fb
,
";
\n
"
);
...
@@ -752,6 +758,11 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
...
@@ -752,6 +758,11 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
AN
(
sym
->
eval
);
AN
(
sym
->
eval
);
AZ
(
*
e
);
AZ
(
*
e
);
sym
->
eval
(
tl
,
e
,
t
,
sym
,
fmt
);
sym
->
eval
(
tl
,
e
,
t
,
sym
,
fmt
);
if
(
tl
->
err
)
{
VSB_printf
(
tl
->
sb
,
"While compiling function call:
\n\n
"
);
vcc_ErrWhere2
(
tl
,
t
,
tl
->
t
);
}
ERRCHK
(
tl
);
ERRCHK
(
tl
);
/* Unless asked for a HEADER, fold to string here */
/* Unless asked for a HEADER, fold to string here */
if
(
*
e
&&
fmt
!=
HEADER
&&
(
*
e
)
->
fmt
==
HEADER
)
{
if
(
*
e
&&
fmt
!=
HEADER
&&
(
*
e
)
->
fmt
==
HEADER
)
{
...
@@ -1372,6 +1383,7 @@ vcc_Act_Call(struct vcc *tl, struct token *t, struct symbol *sym)
...
@@ -1372,6 +1383,7 @@ vcc_Act_Call(struct vcc *tl, struct token *t, struct symbol *sym)
SkipToken
(
tl
,
';'
);
SkipToken
(
tl
,
';'
);
VSB_cat
(
tl
->
fb
,
";
\n
"
);
VSB_cat
(
tl
->
fb
,
";
\n
"
);
}
else
if
(
t
!=
tl
->
t
)
{
}
else
if
(
t
!=
tl
->
t
)
{
VSB_printf
(
tl
->
sb
,
"While compiling function call:
\n\n
"
);
vcc_ErrWhere2
(
tl
,
t
,
tl
->
t
);
vcc_ErrWhere2
(
tl
,
t
,
tl
->
t
);
}
}
vcc_delete_expr
(
e
);
vcc_delete_expr
(
e
);
...
...
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