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

Ilia Mirkin imirkin at alum.mit.edu
Tue May 3 20:45:04 UTC 2016


On Tue, May 3, 2016 at 4:38 PM, Thomas H.P. Andersen <phomes at gmail.com> wrote:
>
>
> On Tue, May 3, 2016 at 9:46 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>>
>> 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.
>
>
> Yep, my mistake. That makes a lot more sense. What now? Do I send an updated
> patch or will you push your fix? No sure what the process is here.

I will not be pushing anything... my knowledge of nir is next to
non-existing. I was just glancing at the diff and pointed out my
observation.

  -ilia


More information about the mesa-dev mailing list