mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 00:14:20 +00:00
Hexagon: Avoid left shifting negative values (it's UB)
Found by ubsan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240521 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cac03419a6
commit
ef4ff212af
@ -34,7 +34,7 @@ public:
|
||||
HexagonResource(unsigned s) { setUnits(s); };
|
||||
|
||||
void setUnits(unsigned s) {
|
||||
Slots = s & ~(-1 << HEXAGON_PACKET_SIZE);
|
||||
Slots = s & ~(~0U << HEXAGON_PACKET_SIZE);
|
||||
setWeight(s);
|
||||
};
|
||||
unsigned setWeight(unsigned s);
|
||||
|
Loading…
x
Reference in New Issue
Block a user