[Mesa-dev] [PATCH] nir: fix check for wildcard pairs

Ilia Mirkin imirkin at alum.mit.edu
Tue May 3 19:46:36 UTC 2016


On Tue, May 3, 2016 at 3:32 PM, Thomas Hindoe Paaboel Andersen
<phomes at gmail.com> wrote:
> It seems that the intention was to check both for null as they are
> dereferenced immediately after.
>
> Added in d3636da9
> ---
>  src/compiler/nir/nir_lower_var_copies.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/nir/nir_lower_var_copies.c b/src/compiler/nir/nir_lower_var_copies.c
> index 707d5af..20b78d8 100644
> --- a/src/compiler/nir/nir_lower_var_copies.c
> +++ b/src/compiler/nir/nir_lower_var_copies.c
> @@ -83,7 +83,7 @@ emit_copy_load_store(nir_intrinsic_instr *copy_instr,
>     nir_deref *src_arr_parent = deref_next_wildcard_parent(src_tail);
>     nir_deref *dest_arr_parent = deref_next_wildcard_parent(dest_tail);
>
> -   if (src_arr_parent || dest_arr_parent) {
> +   if (src_arr_parent && dest_arr_parent) {
>        /* Wildcards had better come in matched pairs */
>        assert(dest_arr_parent && dest_arr_parent);

Actually I'm guessing that the assert was supposed to be
src_arr_parent && dest_arr_parent. And the case where only one of them
is null and the other is not should never happen.

>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list