i965: Add a sanity check for register allocation sizes.
authorEric Anholt <eric@anholt.net>
Fri, 1 Oct 2010 23:35:55 +0000 (16:35 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 2 Oct 2010 00:19:03 +0000 (17:19 -0700)
src/mesa/drivers/dri/i965/brw_fs.cpp

index b38df71a84a6c9a10a567003e32d4b368b64fd84..ba6c048f38ff290054a0e3c6233ea3b418510a03 100644 (file)
@@ -2293,6 +2293,11 @@ fs_visitor::assign_regs()
            break;
       }
       if (i == class_count) {
+        if (this->virtual_grf_sizes[r] >= base_reg_count) {
+           fprintf(stderr, "Object too large to register allocate.\n");
+           this->fail = true;
+        }
+
         class_sizes[class_count++] = this->virtual_grf_sizes[r];
       }
    }