Clean up undefined behavior in complicated and/or/shift expression
Shifting negative values is technically undefined, and we can describe what we want to do in ways that are easier to read.
This commit is contained in:
parent
d037db1086
commit
43a4c89cef
6
mppc.c
6
mppc.c
@ -349,9 +349,9 @@ mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen
|
|||||||
}
|
}
|
||||||
|
|
||||||
match_bits = match_len;
|
match_bits = match_len;
|
||||||
match_len =
|
match_len = (walker >> (32 - match_bits));
|
||||||
((walker >> (32 - match_bits)) & (~(-1 << match_bits))) | (1 <<
|
match_len &= ((1 << match_bits) - 1);
|
||||||
match_bits);
|
match_len |= (1 << match_bits);
|
||||||
walker <<= match_bits;
|
walker <<= match_bits;
|
||||||
walker_len -= match_bits;
|
walker_len -= match_bits;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user