Fix C goto generation for while without continue.

This commit is contained in:
Nigel Tao committed 2017-06-10 14:58:47 +10:00
1 parent 98a07921b1
commit 8e279c51bf
3 files changed
+9 -3

No files matched your search

+4 -1
View File
@@ -759,7 +759,10 @@ func (g *gen) writeStatement(n *a.Node, depth uint32) error {
case a.KJump:
n := n.Jump()
jt := g.perFunc.jumpTargets[n.JumpTarget()]
jt, err := g.jumpTarget(n.JumpTarget())
if err != nil {
return err
}
keyword := "continue"
if n.Keyword().Key() == t.KeyBreak {
keyword = "break"