Fix Stmt size.

This commit is contained in:
Stephen Chung
2021-03-09 23:48:40 +08:00
parent b11b8d6d39
commit 2ff2789326
4 changed files with 29 additions and 21 deletions

View File

@@ -428,9 +428,9 @@ fn optimize_stmt(stmt: &mut Stmt, state: &mut State, preserve_result: bool) {
optimize_expr(condition, state);
}
// for id in expr { block }
Stmt::For(iterable, _, block, _) => {
Stmt::For(iterable, x, _) => {
optimize_expr(iterable, state);
optimize_stmt(block, state, false);
optimize_stmt(&mut x.1, state, false);
}
// let id = expr;
Stmt::Let(expr, _, _) => optimize_expr(expr, state),