Mesa (master): nir/search: Assert that variable id's are in range

Jason Ekstrand jekstrand at kemper.freedesktop.org
Sat May 9 00:29:59 UTC 2015


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Fri May  8 09:42:05 2015 -0700

nir/search: Assert that variable id's are in range

Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>

---

 src/glsl/nir/nir_search.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c
index 713dc4e..1c171f2 100644
--- a/src/glsl/nir/nir_search.c
+++ b/src/glsl/nir/nir_search.c
@@ -98,6 +98,7 @@ match_value(const nir_search_value *value, nir_alu_instr *instr, unsigned src,
 
    case nir_search_value_variable: {
       nir_search_variable *var = nir_search_value_as_variable(value);
+      assert(var->variable < NIR_SEARCH_MAX_VARIABLES);
 
       if (state->variables_seen & (1 << var->variable)) {
          if (!nir_srcs_equal(state->variables[var->variable].src,




More information about the mesa-commit mailing list