From b3711e3eb209797f2f550139681a214af60f5bd3 Mon Sep 17 00:00:00 2001 From: mertcandav Date: Wed, 21 Aug 2024 12:40:30 +0300 Subject: [PATCH] compiler: fix swap optimization analysis may cause crash --- src/julec/opt/scope.jule | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/julec/opt/scope.jule b/src/julec/opt/scope.jule index ab669d8c6..e5b22f597 100644 --- a/src/julec/opt/scope.jule +++ b/src/julec/opt/scope.jule @@ -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