Mesa (main): pan/bi: Make bi_foreach_instr_in_tuple safer

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 12 23:44:37 UTC 2021


Module: Mesa
Branch: main
Commit: 522020e6eafcf9571a28f1d578c8b3b3ace39a14
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=522020e6eafcf9571a28f1d578c8b3b3ace39a14

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Jul 12 12:00:44 2021 -0400

pan/bi: Make bi_foreach_instr_in_tuple safer

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

---

 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 */
 



More information about the mesa-commit mailing list