Implemented variable scopes

This commit is contained in:
Eduard Urbach 2024-07-15 16:51:36 +02:00
parent 96078f40d8
commit 1bf288b8fd
Signed by: eduard
GPG key ID: 49226B848C78F6C8
13 changed files with 81 additions and 26 deletions

View file

@ -18,14 +18,7 @@ func (f *Function) SaveRegister(register cpu.Register) {
}
}
var variable *Variable
for _, v := range f.variables {
if v.Register == register {
variable = v
break
}
}
variable := f.VariableInRegister(register)
if variable == nil || variable.Alive == 0 {
return