projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9631f2
)
Do not crash if the expression of an array designator is not constant.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 20 May 2012 16:53:23 +0000
(18:53 +0200)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 20 May 2012 16:53:23 +0000
(18:53 +0200)
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
0a0cdf6
..
fc156f4
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-1829,7
+1829,8
@@
static bool walk_designator(type_path_t *path, const designator_t *designator,
}
} else {
expression_t *array_index = designator->array_index;
- assert(designator->array_index != NULL);
+ if (is_constant_expression(array_index) != EXPR_CLASS_CONSTANT)
+ return true;
if (!is_type_array(type)) {
if (is_type_valid(type)) {