OSDN Git Service

i965/fs: Check variable_storage return value in fs_visitor::visit
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Mon, 7 Apr 2014 11:37:42 +0000 (14:37 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 26 Jun 2014 12:37:14 +0000 (15:37 +0300)
check variable_storage() found the requested fs_reg.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 6352739..654f5fe 100644 (file)
@@ -155,6 +155,12 @@ void
 fs_visitor::visit(ir_dereference_variable *ir)
 {
    fs_reg *reg = variable_storage(ir->var);
+
+   if (!reg) {
+      fail("Failed to find variable storage for %s\n", ir->var->name);
+      this->result = fs_reg(reg_null_d);
+      return;
+   }
    this->result = *reg;
 }