Simplified Evaluate function

This commit is contained in:
2025-02-27 15:30:44 +01:00
parent 9f78733d5d
commit efb3089211
15 changed files with 98 additions and 96 deletions

View File

@ -59,7 +59,7 @@ func (f *Function) CompileAssignDivision(expr *expression.Expression) error {
}
dividendExpr := right.Children[0]
dividend, isTemporary, err := f.Evaluate(dividendExpr)
dividend, err := f.Evaluate(dividendExpr)
if err != nil {
return err
@ -73,10 +73,6 @@ func (f *Function) CompileAssignDivision(expr *expression.Expression) error {
err = f.Execute(right.Token, dividend.Register, divisor)
f.RegisterRegister(asm.MOVE, quotientVariable.Register, x86.RAX)
f.RegisterRegister(asm.MOVE, remainderVariable.Register, x86.RDX)
if isTemporary {
f.FreeRegister(dividend.Register)
}
f.FreeRegister(dividend.Register)
return err
}