Mesa (master): i965/fs: Check variable_storage return value in fs_visitor: :visit

Ville Syrjala vsyrjala at kemper.freedesktop.org
Thu Jun 26 12:47:13 UTC 2014


Module: Mesa
Branch: master
Commit: db081b497e42556f9f6d771de104bea948c925b5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=db081b497e42556f9f6d771de104bea948c925b5

Author: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Date:   Mon Apr  7 14:37:42 2014 +0300

i965/fs: Check variable_storage return value in fs_visitor::visit

check variable_storage() found the requested fs_reg.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 6352739..654f5fe 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -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;
 }
 




More information about the mesa-commit mailing list