summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-10-11 13:52:45 -0500
committerJason Ekstrand <[email protected]>2018-12-11 21:26:23 -0600
commite1ef6c3c2948883d6f1ed9b33c1e04f52fe31ec2 (patch)
tree6003336aac01da97a40fb9d23cf92bf0752cae75 /src
parent86c45fe960603f97604c885e01f5a69030309809 (diff)
intel/ir: Don't allow allocating zero registers
This simple check helps catch bugs early that can end up propagating into later stages of the compile and triggering strange asserts. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_ir_allocator.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_ir_allocator.h b/src/intel/compiler/brw_ir_allocator.h
index b1237ed38e7..9f124645ba2 100644
--- a/src/intel/compiler/brw_ir_allocator.h
+++ b/src/intel/compiler/brw_ir_allocator.h
@@ -47,6 +47,7 @@ namespace brw {
unsigned
allocate(unsigned size)
{
+ assert(size > 0);
if (capacity <= count) {
capacity = MAX2(16, capacity * 2);
sizes = (unsigned *)realloc(sizes, capacity * sizeof(unsigned));