Type and bounds check "x | y | z".

This commit is contained in:
Nigel Tao committed 2017-07-27 13:07:10 +10:00
1 parent eee67e083d
commit e1be6d9582
6 files changed
+75 -33

No files matched your search

+1 -2
View File
@@ -501,8 +501,7 @@ pri func decoder.init_huff?(which u32[..1], n_codes u32[..289])() {
reversed_code >>= 9 - cl
// TODO: don't assume that the value is a literal.
var value u32 = ((this.symbols[i] as u32) << 8) | cl
value |= 0x40000000
var value u32 = 0x40000000 | ((this.symbols[i] as u32) << 8) | cl
// The table uses max_cl bits, but reversed_code only has cl bits. We
// duplicate the key-value pair across all possible values of the high