mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
nv50/ir: Don't crash on zero sized BitSets.
This commit is contained in:
parent
f0a7ec9a2f
commit
349cb60ed5
1 changed files with 1 additions and 0 deletions
|
|
@ -219,6 +219,7 @@ bool BitSet::allocate(unsigned int nBits, bool zero)
|
|||
if (zero)
|
||||
memset(data, 0, (size + 7) / 8);
|
||||
else
|
||||
if (nBits)
|
||||
data[(size + 31) / 32 - 1] = 0; // clear unused bits (e.g. for popCount)
|
||||
|
||||
return data;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue