aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-05 22:32:19 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-05 22:32:19 +0000
commit207b252f2393735376d9e4b6ddc992808923bff8 (patch)
tree609c36b8d28f8c0691e87c9c648a9458b2b9619a /src
parent1356dfeec28a143b53dc23d8f8440ac419832816 (diff)
Fix checking termination of a procedure
Diffstat (limited to 'src')
-rw-r--r--src/checker/stmt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/checker/stmt.c b/src/checker/stmt.c
index 62764eeef..3a257f884 100644
--- a/src/checker/stmt.c
+++ b/src/checker/stmt.c
@@ -128,14 +128,14 @@ bool check_is_terminating(AstNode *node) {
case_end;
case_ast_node(ws, WhileStmt, node);
- if (ws->cond == NULL && !check_has_break(ws->body, true)) {
- return true;
+ if (ws->cond != NULL && !check_has_break(ws->body, true)) {
+ return check_is_terminating(ws->body);
}
case_end;
case_ast_node(rs, ForStmt, node);
if (!check_has_break(rs->body, true)) {
- return true;
+ return check_is_terminating(rs->body);
}
case_end;