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:
parent
52f21791fb
commit
f15fae822e
4 changed files with 88 additions and 57 deletions
|
@ -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))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue