From f3b5fe715cdb651e9e4f533dd22012eb42e6e6b5 Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Wed, 4 Sep 2019 01:00:16 +0200 Subject: [PATCH] Fix alias resolution during unused code elimination --- src/main/scala/millfork/node/opt/NodeOptimization.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/millfork/node/opt/NodeOptimization.scala b/src/main/scala/millfork/node/opt/NodeOptimization.scala index cb952457..f5824aff 100644 --- a/src/main/scala/millfork/node/opt/NodeOptimization.scala +++ b/src/main/scala/millfork/node/opt/NodeOptimization.scala @@ -19,9 +19,9 @@ trait NodeOptimization { var result = set var lastSize = set.size do { - lastSize = set.size + lastSize = result.size result = result.flatMap(name => aliases.get(name).fold(Set(name))(Set(_, name))) - } while(lastSize != set.size) + } while(lastSize != result.size) result }