From ede0590eade54c5c0a2873d574f5be6f9b41c93b Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 20 Nov 2021 20:14:37 +1100 Subject: [PATCH] Add while label to std/deflate decode_huffman_slow --- release/c/wuffs-unsupported-snapshot.c | 4 ++-- std/deflate/decode_huffman_slow.wuffs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 65cbc4f1..727230c4 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -28176,13 +28176,13 @@ wuffs_deflate__decoder__decode_huffman_slow( &iop_a_dst, io0_a_dst, io2_a_dst, v_length, (v_dist_minus_1 + 1)); if (v_length <= v_n_copied) { v_length = 0; - goto label__5__break; + goto label__inner__break; } v_length -= v_n_copied; status = wuffs_base__make_status(wuffs_base__suspension__short_write); WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(10); } - label__5__break:; + label__inner__break:; } label__loop__break:; self->private_impl.f_bits = v_bits; diff --git a/std/deflate/decode_huffman_slow.wuffs b/std/deflate/decode_huffman_slow.wuffs index 9a455551..44b7f579 100644 --- a/std/deflate/decode_huffman_slow.wuffs +++ b/std/deflate/decode_huffman_slow.wuffs @@ -201,7 +201,7 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader) n_bits -= table_entry_n_bits } - while true { + while.inner true { // Copy from this.history. if ((dist_minus_1 + 1) as base.u64) > args.dst.history_length() { // Set (hlen, hdist) to be the length-distance pair to copy @@ -255,11 +255,11 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader) up_to: length, distance: (dist_minus_1 + 1)) if length <= n_copied { length = 0 - break + break.inner } length -= n_copied yield? base."$short write" - } endwhile + } endwhile.inner } endwhile.loop // TODO: "assert n_bits < 8"? What about (bits >> n_bits)?