[1/2] nir: Add missing parentheses

Submitted by Alyssa Rosenzweig on March 12, 2019, 2:30 a.m.

Details

Message ID 20190312023051.11402-1-alyssa@rosenzweig.io
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig March 12, 2019, 2:30 a.m.
Fixes a gcc warning (and a theoretical NULL dereference error, though I
suppose shortcircuiting avoids that).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
---
 src/compiler/nir/nir_loop_analyze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index bc116f4d1d7..c8304611b28 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -843,7 +843,7 @@  try_find_trip_count_vars_in_iand(nir_alu_instr **alu,
    }
 
    /* Try the other iand src if needed */
-   if (*ind == NULL || *ind && (*ind)->type != basic_induction ||
+   if (*ind == NULL || (*ind && (*ind)->type != basic_induction) ||
        !is_var_constant(*limit)) {
       src = iand->src[1].src.ssa;
       if (src->parent_instr->type == nir_instr_type_alu) {

Comments

This patch is

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

On March 11, 2019 21:31:03 Alyssa Rosenzweig <alyssa@rosenzweig.io> wrote:

> Fixes a gcc warning (and a theoretical NULL dereference error, though I
> suppose shortcircuiting avoids that).
>
> Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> ---
> src/compiler/nir/nir_loop_analyze.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/nir/nir_loop_analyze.c 
> b/src/compiler/nir/nir_loop_analyze.c
> index bc116f4d1d7..c8304611b28 100644
> --- a/src/compiler/nir/nir_loop_analyze.c
> +++ b/src/compiler/nir/nir_loop_analyze.c
> @@ -843,7 +843,7 @@ try_find_trip_count_vars_in_iand(nir_alu_instr **alu,
>    }
>
>    /* Try the other iand src if needed */
> -   if (*ind == NULL || *ind && (*ind)->type != basic_induction ||
> +   if (*ind == NULL || (*ind && (*ind)->type != basic_induction) ||
>        !is_var_constant(*limit)) {
>       src = iand->src[1].src.ssa;
>       if (src->parent_instr->type == nir_instr_type_alu) {
> --
> 2.20.1