Implemented variable scopes
This commit is contained in:
parent
96078f40d8
commit
1bf288b8fd
13 changed files with 81 additions and 26 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue