Fix bug with optimizing op-assignment operators.

This commit is contained in:
Stephen Chung
2022-01-23 21:09:37 +08:00
parent 5c0cf70f70
commit 97be256a1a
5 changed files with 31 additions and 5 deletions

View File

@@ -423,7 +423,7 @@ fn optimize_stmt(stmt: &mut Stmt, state: &mut OptimizerState, preserve_result: b
match x.2 {
Expr::FnCall(ref mut x2, _) => {
state.set_dirty();
x.1 = Some(OpAssignment::new(&x2.name));
x.1 = Some(OpAssignment::new_from_base(&x2.name));
let value = mem::take(&mut x2.args[1]);