Don't over-generate temporary variables.

This commit is contained in:
Nigel Tao committed 2017-06-16 13:09:12 +10:00
1 parent d059fff2ae
commit 540274b57d
1 file changed
+6 -6
+6 -6
View File
@@ -960,14 +960,14 @@ func (g *gen) writeCallSuspendibles(n *a.Expr, depth uint32) error {
return nil
}
if g.perFunc.tempW > maxTemp {
return fmt.Errorf("too many temporary variables required")
}
temp := g.perFunc.tempW
g.perFunc.tempW++
// TODO: delete these hacks that only matches "in.src.read_u8?()" etc.
if isInSrcReadU8(g.tm, n) {
if g.perFunc.tempW > maxTemp {
return fmt.Errorf("too many temporary variables required")
}
temp := g.perFunc.tempW
g.perFunc.tempW++
// TODO: suspend coroutine state.
g.printf("if (%ssrc->ri >= %ssrc->wi) { status = "+
"%ssrc->closed ? puffs_%s_error_unexpected_eof : puffs_%s_status_short_read;",