mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-14 00:47:18 +00:00
Change comparsion for checking if number is negative to include 128
Reason: The last byte in Little Endian representation of negative integers start at 128 (Ox80) till 255 (OxFF). The comparison before the fix didn't check for 128 which made is_negative variable as false.
This commit is contained in:
parent
85493dfdb0
commit
b8017928af
1 changed files with 1 additions and 1 deletions
|
@ -2122,7 +2122,7 @@ impl Evaluator<'_> {
|
|||
}
|
||||
|
||||
pub fn pad16(x: &[u8], is_signed: bool) -> [u8; 16] {
|
||||
let is_negative = is_signed && x.last().unwrap_or(&0) > &128;
|
||||
let is_negative = is_signed && x.last().unwrap_or(&0) > &127;
|
||||
let fill_with = if is_negative { 255 } else { 0 };
|
||||
x.iter()
|
||||
.copied()
|
||||
|
|
Loading…
Reference in a new issue