Added missing register deallocation
This commit is contained in:
@ -42,13 +42,17 @@ func (f *Function) CompileAssignArray(node *ast.Assign) error {
|
||||
|
||||
memory.Offset = byte(offset)
|
||||
} else {
|
||||
_, indexRegister, err := f.Evaluate(index)
|
||||
_, indexRegister, isTemporary, err := f.Evaluate(index)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
memory.OffsetRegister = indexRegister
|
||||
|
||||
if isTemporary {
|
||||
defer f.FreeRegister(indexRegister)
|
||||
}
|
||||
}
|
||||
|
||||
_, err := f.ExpressionToMemory(right, memory)
|
||||
|
Reference in New Issue
Block a user