Fix some built-in methods' effects

This commit is contained in:
Nigel Tao committed 2018-05-12 17:55:57 +10:00
1 parent 2919e51575
commit 131732e7eb
8 files changed
+21 -24

No files matched your search

+2 -2
View File
@@ -334,7 +334,7 @@ pri func decoder.decode_id?(dst base.io_writer, src base.io_reader)() {
this.previous_lzw_decode_ended_abruptly = true
while true {
in.src.set_mark()
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
@@ -342,7 +342,7 @@ pri func decoder.decode_id?(dst base.io_writer, src base.io_reader)() {
// 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)
in.src.set_limit!(l:block_size)
var z base.status = try this.lzw.decode?(dst:in.dst, src:in.src)
}
if z.is_ok() {
+1 -1
View File
@@ -110,7 +110,7 @@ pri func lzw_decoder.decode?(dst base.io_writer, src base.io_reader)() {
inv c < 256,
{
var expansion slice base.u8 = this.stack[s:]
var n_copied base.u64 = in.dst.copy_from_slice(s:expansion)
var n_copied base.u64 = in.dst.copy_from_slice!(s:expansion)
if n_copied == expansion.length() {
break
}