From afb64311e3484002e06aeac62187b68467610449 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 1 Oct 2010 16:35:55 -0700 Subject: [PATCH] i965: Add a sanity check for register allocation sizes. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b38df71a84a..ba6c048f38f 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -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]; } } -- 2.30.2