diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-04-25 09:46:30 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-04-25 09:46:30 +0100 |
| commit | a80872b60d730d76c4253e7c27eb735dfd13e635 (patch) | |
| tree | ba27c107ed092a2184bdd751190fb5ba9f2bd7c9 /src/check_stmt.c | |
| parent | 822bb51b55bc62f9d406db80e9d5a71d3a300a19 (diff) | |
Fix checking if a procedure terminates for `for` loops.
Diffstat (limited to 'src/check_stmt.c')
| -rw-r--r-- | src/check_stmt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/check_stmt.c b/src/check_stmt.c index 8b64ef30f..f34c4c837 100644 --- a/src/check_stmt.c +++ b/src/check_stmt.c @@ -125,15 +125,13 @@ bool check_is_terminating(AstNode *node) { case_end; case_ast_node(fs, ForStmt, node); - if (!check_has_break(fs->body, true)) { + if (fs->cond == NULL && !check_has_break(fs->body, true)) { return check_is_terminating(fs->body); } case_end; case_ast_node(rs, RangeStmt, node); - if (!check_has_break(rs->body, true)) { - return check_is_terminating(rs->body); - } + return false; case_end; case_ast_node(ms, MatchStmt, node); |