Add comment about set_limit subtleties
@@ -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)
}
