cgen: simplify 1-elem in-case-of-recursion arrays

This commit is contained in:
Nigel Tao committed 2023-11-05 11:44:21 +11:00
1 parent df1d4f64e2
commit 2c2bb9baa5
6 files changed
+1025 -1034

No files matched your search

+1 -2
View File
@@ -66,8 +66,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, sideEffectsOnly bool, depth u
} else if ident == t.IDCoroutineResumed {
if g.currFunk.astFunc.Effect().Coroutine() {
// TODO: don't hard-code [0], and allow recursive coroutines.
b.printf("(self->private_impl.%s%s[0] != 0)",
b.printf("(self->private_impl.%s%s != 0)",
pPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
} else {
b.writes("false")