summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_search.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-05-08 09:42:05 -0700
committerJason Ekstrand <[email protected]>2015-05-08 17:29:15 -0700
commite0cfe59c37245d8555202a12b9b29866894d6d18 (patch)
tree3349a98b95b1afd7ab7772594d81605176f8da70 /src/glsl/nir/nir_search.c
parent13facfbd5b067daedc972c1a4fb2f2142fcbc190 (diff)
nir/search: Assert that variable id's are in range
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_search.c')
-rw-r--r--src/glsl/nir/nir_search.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c
index 713dc4eedff..1c171f2a729 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,