From fa373e7dc2ef5ac441672bdb81c6d1d0682e7b90 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 18 Jul 2024 11:40:07 +0200 Subject: [PATCH] Improved variable lifetime comments --- src/build/core/CompileDefinition.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/build/core/CompileDefinition.go b/src/build/core/CompileDefinition.go index 52bafe3..bbc544b 100644 --- a/src/build/core/CompileDefinition.go +++ b/src/build/core/CompileDefinition.go @@ -63,10 +63,6 @@ func (f *Function) useVariable(variable *Variable) { continue } - if config.Comments { - f.Comment("%s (%s) used in scope %d", local.Name, local.Register, i) - } - local.Alive-- if local.Alive < 0 { @@ -79,6 +75,8 @@ func (f *Function) useVariable(variable *Variable) { } scope.Free(local.Register) + } else if config.Comments { + f.Comment("%s (%s) used in scope %d", local.Name, local.Register, i) } } }