Add comment about set_limit subtleties

This commit is contained in:
Nigel Tao committed 2018-05-12 15:49:19 +10:00
1 parent daecfc08b1
commit 84724a76a2
1 file changed
+6
+6
View File
@@ -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)
}