Fix r23842 for for statements without condition.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 20 Nov 2008 10:48:41 +0000 (10:48 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 20 Nov 2008 10:48:41 +0000 (10:48 +0000)
[r23843]

parser.c

index 149ec1c..ac95ff2 100644 (file)
--- 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);