Decode a GIF's loop count

This commit is contained in:
Nigel Tao committed 2018-02-10 17:14:49 +11:00
1 parent ded38a043a
commit 584fc631a8
5 files changed
+636 -60

No files matched your search

+16
View File
@@ -549,6 +549,14 @@ func (g *gen) writeCallSuspendibles(b *buffer, n *a.Expr, depth uint32) error {
}
b.writes("if (status) { goto suspend; }\n")
} else if isThisMethod(g.tm, n, "decode_ae", 1) {
b.printf("status = %s%s__decode_ae(self, %ssrc);\n",
g.pkgPrefix, g.currFunk.astFunc.Receiver().Str(g.tm), aPrefix)
if err := g.writeLoadExprDerivedVars(b, n); err != nil {
return err
}
b.writes("if (status) { goto suspend; }\n")
} else if isThisMethod(g.tm, n, "decode_id", 2) {
b.printf("status = %s%s__decode_id(self, %sdst, %ssrc);\n",
g.pkgPrefix, g.currFunk.astFunc.Receiver().Str(g.tm), aPrefix, aPrefix)
@@ -557,6 +565,14 @@ func (g *gen) writeCallSuspendibles(b *buffer, n *a.Expr, depth uint32) error {
}
b.writes("if (status) { goto suspend; }\n")
} else if isThisMethod(g.tm, n, "skip_blocks", 1) {
b.printf("status = %s%s__skip_blocks(self, %ssrc);\n",
g.pkgPrefix, g.currFunk.astFunc.Receiver().Str(g.tm), aPrefix)
if err := g.writeLoadExprDerivedVars(b, n); err != nil {
return err
}
b.writes("if (status) { goto suspend; }\n")
} else if isThisMethod(g.tm, n, "decode_blocks", 2) {
// TODO: don't hard code being inside a try call.
if g.currFunk.tempW > maxTemp {