For "x shift y", check that y < (x's bit-size)

This commit is contained in:
Nigel Tao committed 2019-01-26 16:51:49 +11:00
1 parent 65c2f4971f
commit 705a84723a
6 files changed
+65 -36

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ pri func decoder.decode_huffman_fast!(dst base.io_writer, src base.io_reader) ba
var hlen base.u32[..0x7FFF]
var hdist base.u32
if (this.n_bits >= 8) or ((this.bits >> this.n_bits) != 0) {
if (this.n_bits >= 8) or ((this.bits >> (this.n_bits & 7)) != 0) {
return "?internal error: inconsistent n_bits"
}