Limit the number of coroutines per type to 0x7FFF

This commit is contained in:
Nigel Tao committed 2021-05-02 16:50:29 +10:00
1 parent b8f87debe3
commit a0984dcdd3
1 file changed
+3
+3
View File
@@ -292,6 +292,9 @@ func (g *gen) gatherFuncImpl(_ *buffer, n *a.Func) error {
if n.Public() && n.Effect().Coroutine() {
g.numPublicCoroutines[n.Receiver()]++
coroID = g.numPublicCoroutines[n.Receiver()]
if coroID >= 0x8000 {
return fmt.Errorf("too many coroutines for %q", n.Receiver().Str(g.tm))
}
}
g.currFunk = funk{