File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1889,13 +1889,16 @@ class IfStmt : public Stmt
18891889 branches.push_back (then_block->check_return_case ());
18901890
18911891 for (IfStmt* i : elifs) {
1892+ i->isElif = true ;
18921893 branches.push_back (i->check_return_case ());
18931894 }
18941895
18951896 if (else_block) {
18961897 branches.push_back (else_block->check_return_case ());
18971898 } else {
1898- branches.push_back (ReturnInfo (NO_RETURN, false , false ));
1899+ if (!isElif) {
1900+ branches.push_back (ReturnInfo (NO_RETURN, false , false ));
1901+ }
18991902 }
19001903
19011904 return combine_if (branches);
@@ -1993,6 +1996,7 @@ class IfStmt : public Stmt
19931996 Block *then_block;
19941997 std::vector<IfStmt *> elifs;
19951998 Block *else_block;
1999+ bool isElif = false ;
19962000};
19972001
19982002class LoopStmt : public Stmt
Original file line number Diff line number Diff line change @@ -1093,6 +1093,7 @@ class IfStmt : public Stmt
10931093
10941094 for (IfStmt *i : elifs)
10951095 {
1096+ i->isElif = true ;
10961097 branches.push_back (i->check_return_case ());
10971098 }
10981099
@@ -1102,7 +1103,9 @@ class IfStmt : public Stmt
11021103 }
11031104 else
11041105 {
1105- branches.push_back (ReturnInfo (NO_RETURN, false , false ));
1106+ if (!isElif) {
1107+ branches.push_back (ReturnInfo (NO_RETURN, false , false ));
1108+ }
11061109 }
11071110
11081111 return combine_if (branches);
@@ -1113,6 +1116,7 @@ class IfStmt : public Stmt
11131116 Block *then_block;
11141117 std::vector<IfStmt *> elifs;
11151118 Block *else_block;
1119+ bool isElif = false ;
11161120};
11171121
11181122class LoopStmt : public Stmt
You can’t perform that action at this time.
0 commit comments