From 522020e6eafcf9571a28f1d578c8b3b3ace39a14 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 12 Jul 2021 12:00:44 -0400 Subject: [PATCH] pan/bi: Make bi_foreach_instr_in_tuple safer Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/compiler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index d556acde651..fa20643a9d5 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -730,9 +730,9 @@ bi_node_to_index(unsigned node, unsigned node_count) bi_foreach_instr_in_block_rev_safe((bi_block *) v_block, v) #define bi_foreach_instr_in_tuple(tuple, v) \ - for (bi_instr *v = tuple->fma ?: tuple->add; \ + for (bi_instr *v = (tuple)->fma ?: (tuple)->add; \ v != NULL; \ - v = (v == tuple->add) ? NULL : tuple->add) + v = (v == (tuple)->add) ? NULL : (tuple)->add) /* Based on set_foreach, expanded with automatic type casts */