Simplified Evaluate function
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user