diff options
author | Francisco Jerez <[email protected]> | 2011-11-19 21:31:28 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-04-14 21:54:00 +0200 |
commit | 349cb60ed58e42341351c5f0ebd186acb8f12005 (patch) | |
tree | c6f0c815692af311b92faa0e06e023fea9eedce2 /src/gallium | |
parent | f0a7ec9a2fad56eeb70c76202c21c97a33915d0b (diff) |
nv50/ir: Don't crash on zero sized BitSets.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_util.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_util.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_util.cpp index 56d53b48ddd..4eaaa9602c1 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_util.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_util.cpp @@ -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; |