From: Christoph Mallon Date: Mon, 1 Sep 2008 13:25:40 +0000 (+0000) Subject: Fix bug in duplicate case value checker: Ignore the default case label. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=d8400180c8193139fbdfb998e101024d38df4504;p=cparser Fix bug in duplicate case value checker: Ignore the default case label. [r21628] --- diff --git a/parser.c b/parser.c index 45d0d8e..799fa7b 100644 --- a/parser.c +++ b/parser.c @@ -8256,7 +8256,7 @@ static statement_t *parse_case_statement(void) /* Check for duplicate case values */ case_label_statement_t *c = &statement->case_label; for (case_label_statement_t *l = current_switch->first_case; l != NULL; l = l->next) { - if (l->is_bad || l->is_empty) + if (l->is_bad || l->is_empty || l->expression == NULL) continue; if (c->last_case < l->first_case || c->first_case > l->last_case)