1
Fork 0

rustc_serialize: fix incorrect signed LEB128 decoding

The signed LEB128 decoding function used a hardcoded constant of 64
instead of the number of bits in the type of integer being decoded,
which resulted in incorrect results for some inputs. Fix this, make the
decoding more consistent with the unsigned version, and increase the
LEB128 encoding and decoding test coverage.
This commit is contained in:
Tyson Nottingham 2020-12-29 15:14:33 -08:00
parent 52f21791fb
commit f15fae822e
4 changed files with 88 additions and 57 deletions

View file

@ -17,6 +17,7 @@ Core encoding and decoding interfaces.
#![feature(min_specialization)]
#![feature(vec_spare_capacity)]
#![feature(core_intrinsics)]
#![feature(int_bits_const)]
#![feature(maybe_uninit_slice)]
#![feature(new_uninit)]
#![cfg_attr(test, feature(test))]