[Mesa-dev] [PATCH] nir/search: Assert that variable id's are in range

Connor Abbott cwabbott0 at gmail.com
Fri May 8 14:40:14 PDT 2015


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

On Fri, May 8, 2015 at 3:13 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  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 5ba0160..d86655b 100644
> --- a/src/glsl/nir/nir_search.c
> +++ b/src/glsl/nir/nir_search.c
> @@ -90,6 +90,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,
> --
> 2.4.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list