Fixed missing register move in if statements

This commit is contained in:
Eduard Urbach 2025-02-03 13:17:48 +01:00
parent d3823e9cfe
commit f2f0624638
Signed by: eduard
GPG key ID: 49226B848C78F6C8
5 changed files with 63 additions and 14 deletions

View file

@ -9,6 +9,10 @@ import (
// CompileIf compiles a branch instruction.
func (f *Function) CompileIf(branch *ast.If) error {
for _, register := range f.CPU.Input {
f.SaveRegister(register)
}
f.count.branch++
var (