From 84724a76a2452a2c12c9a96dc1ee2e5ddecc60a6 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 12 May 2018 14:50:23 +1000 Subject: [PATCH] Add comment about set_limit subtleties --- std/gif/decode_gif.wuffs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/std/gif/decode_gif.wuffs b/std/gif/decode_gif.wuffs index e042564b..dfa97586 100644 --- a/std/gif/decode_gif.wuffs +++ b/std/gif/decode_gif.wuffs @@ -336,6 +336,12 @@ pri func decoder.decode_id?(dst base.io_writer, src base.io_reader)() { while true { in.src.set_mark() io_bind (in.src) { + // TODO: enforce that calling r.set_limit has a precondition + // that r.is_bound(), and that you can't suspend inside an + // io_bind? Otherwise, the cgen implementation becomes more + // complicated if we must save and re-apply limits. + // + // Should calling r.set_mark also require r.is_bound()? in.src.set_limit(l:block_size) var z base.status = try this.lzw.decode?(dst:in.dst, src:in.src) }