diff options
| author | gingerBill <bill@gingerbill.org> | 2021-08-23 17:42:54 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-08-23 17:42:54 +0100 |
| commit | fe2ad54f6074ad2fdd9e8107a4c6ca46b9a4922f (patch) | |
| tree | ef3fda46478f86bd87a7ab0c97235347a23f2e1b /src/check_stmt.cpp | |
| parent | b014879159a33a86bf94d673152cc51120fc3e72 (diff) | |
Fix bug in `check_is_terminating`
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 6943f3d97..fc6dd757e 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -263,6 +263,9 @@ bool check_is_terminating(Ast *node, String const &label) { if (tv.value.value_bool) { return check_is_terminating(ws->body, label); } else { + if (ws->else_stmt == nullptr) { + return false; + } return check_is_terminating(ws->else_stmt, label); } } |