Fixed an incorrect register move
This commit is contained in:
parent
b1f0d20394
commit
df5813515d
2 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,10 @@ import (
|
|||
|
||||
// CompileLoop compiles a loop instruction.
|
||||
func (f *Function) CompileLoop(loop *ast.Loop) error {
|
||||
for _, register := range f.CPU.Input {
|
||||
f.SaveRegister(register)
|
||||
}
|
||||
|
||||
f.count.loop++
|
||||
label := fmt.Sprintf("%s_loop_%d", f.UniqueName, f.count.loop)
|
||||
f.AddLabel(label)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue