projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e08a25
)
Resolve another null pointer access.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 29 Nov 2008 15:24:29 +0000
(15:24 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 29 Nov 2008 15:24:29 +0000
(15:24 +0000)
[r24143]
ast.c
patch
|
blob
|
history
diff --git
a/ast.c
b/ast.c
index
c084a7f
..
036c7c7
100644
(file)
--- a/
ast.c
+++ b/
ast.c
@@
-1036,9
+1036,13
@@
static void print_declaration_statement(
{
bool first = true;
entity_t *entity = statement->declarations_begin;
- for (;
- entity != statement->declarations_end->base.next;
- entity = entity->base.next) {
+ if (entity == NULL) {
+ fputs("/* empty declaration statement */\n", out);
+ return;
+ }
+
+ entity_t *const end = statement->declarations_end->base.next;
+ for (; entity != end; entity = entity->base.next) {
if (!is_declaration(entity) && entity->kind != ENTITY_TYPEDEF)
continue;
if (is_generated_entity(entity))