From: Christoph Mallon Date: Thu, 20 Nov 2008 10:48:41 +0000 (+0000) Subject: Fix r23842 for for statements without condition. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=00e4820e568d974c8f682cb2c546a3cce7f5c7b8;p=cparser Fix r23842 for for statements without condition. [r23843] --- diff --git a/parser.c b/parser.c index 149ec1c..ac95ff2 100644 --- a/parser.c +++ b/parser.c @@ -6047,10 +6047,14 @@ continue_for:; expression_t const *const cond = fors->condition; - if (!expression_returns(cond)) + int val; + if (cond == NULL) { + val = 1; + } else if (expression_returns(cond)) { + val = determine_truth(cond); + } else { return; - - int const val = cond == NULL ? 1 : determine_truth(cond); + } if (val >= 0) check_reachable(fors->body);