projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39ea9e1
)
Do not crash, when __builtin_va_start() is used outside of a function and report...
author
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 17 May 2012 16:57:48 +0000
(18:57 +0200)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 19 May 2012 08:10:36 +0000
(10:10 +0200)
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
0695e71
..
e7eb0a9
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-6435,7
+6435,9
@@
static expression_t *parse_va_start(void)
rem_anchor_token(')');
expect(')');
- if (param->kind == EXPR_REFERENCE) {
+ if (!current_function) {
+ errorf(&expression->base.source_position, "'va_start' used outside of function");
+ } else if (param->kind == EXPR_REFERENCE) {
entity_t *const entity = param->reference.entity;
if (!current_function->base.type->function.variadic) {
errorf(¶m->base.source_position,