Fixed missing register move in if statements
This commit is contained in:
parent
d3823e9cfe
commit
f2f0624638
5 changed files with 63 additions and 14 deletions
|
@ -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 (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue