ugo
ugo copied to clipboard
Huge Logical Error
In compiler.go
// if.body
func() {
defer p.restoreScope(p.scope)
p.enterScope()
fmt.Fprintf(w, "\n%s:\n", ifBody)
if stmt.Else != nil {
p.compileStmt(w, stmt.Body)
fmt.Fprintf(w, "\tbr label %%%s\n", ifElse) // here
} else {
p.compileStmt(w, stmt.Body)
fmt.Fprintf(w, "\tbr label %%%s\n", ifEnd)
}
}()
the ifElse
should be ifEnd
!
By the way, I am also curious about why labels ifInit
and ifCond
are needed, since they are branched to immediately.