Eliminate obsolete coroSuspPoint check

This commit is contained in:
Nigel Tao committed 2018-11-24 21:25:28 +11:00
1 parent 248436c231
commit 87a4ef25d2
1 file changed
+2 -2
+2 -2
View File
@@ -157,11 +157,11 @@ func (g *gen) writeFuncImpl(b *buffer, n *a.Func) error {
}
b.writes("{\n")
b.writex(k.bPrologue)
if k.astFunc.Effect().Coroutine() && k.coroSuspPoint > 0 {
if k.astFunc.Effect().Coroutine() {
b.writex(k.bBodyResume)
}
b.writex(k.bBody)
if k.astFunc.Effect().Coroutine() && k.coroSuspPoint > 0 {
if k.astFunc.Effect().Coroutine() {
b.writex(k.bBodySuspend)
} else if k.hasGotoOK {
b.writes("\ngoto ok;ok:\n") // The goto avoids the "unused label" warning.