• Kirill Smelkov's avatar
    encoder: Fix int ranges for which BININT1 and BININT2 are emitted · 6ce3a6ee
    Kirill Smelkov authored
    BININT1 emits unsigned integer that fits into 1 byte.
    BININT2 emits unsigned integer that fits into 2 bytes.
    
    So they cover [0, 0xff] and [0, 0xffff] ranges including edges. However
    we were emitting BININTX opcodes only for numbers being strictly inside
    those ranges - i.e. (0, 0xff) and (0, 0xffff) - without edges. As the
    result what could be emitted as "K\x00." was emitted as
    "J\x00\x00\x00\x00." and so on.
    
    Fix it by emitting BININT1 for [0, 0xff] inclusive and BININT for [0,
    0xffff] also inclusive.
    6ce3a6ee
test-25e095932ec372c0b51b0c617d2288e794178e77.pickle 4 Bytes