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

Author: Ian Romanick <ian.d.roman...@intel.com>
Date:   Mon Sep 11 11:10:30 2023 -0700

intel/compiler: Limit scope of cur_endif variable

Reviewed-by: Caio Oliveira <caio.olive...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>

---

 src/intel/compiler/brw_cfg.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_cfg.cpp b/src/intel/compiler/brw_cfg.cpp
index 7245fcf651b..52e1e326b11 100644
--- a/src/intel/compiler/brw_cfg.cpp
+++ b/src/intel/compiler/brw_cfg.cpp
@@ -180,7 +180,6 @@ cfg_t::cfg_t(const backend_shader *s, exec_list 
*instructions) :
    bblock_t *entry = new_block();
    bblock_t *cur_if = NULL;    /**< BB ending with IF. */
    bblock_t *cur_else = NULL;  /**< BB ending with ELSE. */
-   bblock_t *cur_endif = NULL; /**< BB starting with ENDIF. */
    bblock_t *cur_do = NULL;    /**< BB starting with DO. */
    bblock_t *cur_while = NULL; /**< BB immediately following WHILE. */
    exec_list if_stack, else_stack, do_stack, while_stack;
@@ -206,7 +205,6 @@ cfg_t::cfg_t(const backend_shader *s, exec_list 
*instructions) :
 
         cur_if = cur;
         cur_else = NULL;
-         cur_endif = NULL;
 
         /* Set up our immediately following block, full of "then"
          * instructions.
@@ -231,6 +229,8 @@ cfg_t::cfg_t(const backend_shader *s, exec_list 
*instructions) :
         break;
 
       case BRW_OPCODE_ENDIF: {
+         bblock_t *cur_endif;
+
          if (cur->instructions.is_empty()) {
             /* New block was just created; use it. */
             cur_endif = cur;

Reply via email to