Static analysis showed the unsigned int y is truncated to an unsigned char via _rotr16. It does not appear to be a problem with the library, but it may be a problem for users. The assert will alert in Debug builds (but not Release builds)
parent
e67480dd9e
commit
457eaeaf23
1
misc.h
1
misc.h
|
|
@ -708,6 +708,7 @@ template<> inline word16 rotlFixed<word16>(word16 x, unsigned int y)
|
||||||
template<> inline word16 rotrFixed<word16>(word16 x, unsigned int y)
|
template<> inline word16 rotrFixed<word16>(word16 x, unsigned int y)
|
||||||
{
|
{
|
||||||
assert(y < 8*sizeof(x));
|
assert(y < 8*sizeof(x));
|
||||||
|
assert(y <= 255);
|
||||||
return y ? _rotr16(x, y) : x;
|
return y ? _rotr16(x, y) : x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue