Fixed variable lifetime in loops
This commit is contained in:
parent
43a6e85929
commit
c2b42fe2ea
11 changed files with 90 additions and 18 deletions
|
@ -51,6 +51,10 @@ func (f *Function) CompileCall(root *expression.Expression) error {
|
|||
f.Call(funcName)
|
||||
}
|
||||
|
||||
for _, register := range registers {
|
||||
f.Scope().Free(register)
|
||||
}
|
||||
|
||||
// Pop
|
||||
for i := len(f.cpu.General) - 1; i >= 0; i-- {
|
||||
register := f.cpu.General[i]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue