mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 00:52:18 +01:00
Limit the number of coroutines per type to 0x7FFF
This commit is contained in:
1 parent
b8f87debe3
commit
a0984dcdd3
1 file changed
+3
@@ -292,6 +292,9 @@ func (g *gen) gatherFuncImpl(_ *buffer, n *a.Func) error {
|
|||||||
if n.Public() && n.Effect().Coroutine() {
|
if n.Public() && n.Effect().Coroutine() {
|
||||||
g.numPublicCoroutines[n.Receiver()]++
|
g.numPublicCoroutines[n.Receiver()]++
|
||||||
coroID = 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{
|
g.currFunk = funk{
|
||||||
|
|||||||
Reference in new issue
Block a user