Moved register state to scopes

This commit is contained in:
2024-07-16 15:30:28 +02:00
parent d1ccd60139
commit d6d018c5c5
22 changed files with 230 additions and 129 deletions

View File

@ -34,13 +34,13 @@ func (f *Function) Compare(comparison *expression.Expression) error {
return f.Execute(comparison.Token, f.cpu.Output[0], right)
}
tmp := f.cpu.MustFindFree(f.cpu.General)
tmp := f.Scope().MustFindFree(f.cpu.General)
err := f.ExpressionToRegister(left, tmp)
if err != nil {
return err
}
defer f.cpu.Free(tmp)
defer f.Scope().Free(tmp)
return f.Execute(comparison.Token, tmp, right)
}