Reordered counters
This commit is contained in:
parent
1bf288b8fd
commit
c925fe69b3
4 changed files with 11 additions and 8 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
// CompileIf compiles a branch instruction.
|
||||
func (f *Function) CompileIf(branch *ast.If) error {
|
||||
f.count.branch++
|
||||
success := fmt.Sprintf("%s_if_%d_true", f.Name, f.count.branch)
|
||||
fail := fmt.Sprintf("%s_if_%d_false", f.Name, f.count.branch)
|
||||
err := f.CompileCondition(branch.Condition, success, fail)
|
||||
|
@ -16,7 +17,6 @@ func (f *Function) CompileIf(branch *ast.If) error {
|
|||
return err
|
||||
}
|
||||
|
||||
f.count.branch++
|
||||
f.AddLabel(success)
|
||||
f.pushScope()
|
||||
err = f.CompileAST(branch.Body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue