Skip to content

Commit

Permalink
Don't return an undefined Stmt() from IfThenElse visitor (#7816)
Browse files Browse the repository at this point in the history
Fixes #7815
  • Loading branch information
abadams authored Sep 1, 2023
1 parent 24d846c commit ddfb1dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Simplify_Stmts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ Stmt Simplify::visit(const IfThenElse *op) {
if (else_unreachable) {
return then_case;
} else if (then_unreachable) {
return else_case;
if (else_case.defined()) {
return else_case;
} else {
return Evaluate::make(0);
}
}

if (is_no_op(else_case)) {
Expand Down

0 comments on commit ddfb1dc

Please sign in to comment.