Skip to content

Commit

Permalink
compiler: fix swap optimization analysis may cause crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 21, 2024
1 parent d7dc0e4 commit b3711e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/julec/opt/scope.jule
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ impl scopeOptimizer {
}

fn tryOptimizeSwap(mut &self, mut &assign: &MultiAssign): bool {
if !Assign || len(assign.L) != 2 {
if !Assign || len(assign.L) != 2 ||
assign.L[0] == nil || assign.L[1] == nil {
ret false
}
let mut tup: &TupleExprModel
Expand Down

0 comments on commit b3711e3

Please sign in to comment.