[Mesa-dev] [PATCH 1/2] i965/fs: check if we do an out-of-bounds access before actually doing it

Samuel Iglesias Gonsálvez siglesias at igalia.com
Thu Feb 16 11:16:19 UTC 2017


Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index 5c6f3d490f0..5ef92897b62 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -363,8 +363,8 @@ void fs_visitor::calculate_payload_ranges(int payload_node_count,
                continue;
 
             for (unsigned j = 0; j < regs_read(inst, i); j++) {
-               payload_last_use_ip[node_nr + j] = use_ip;
                assert(node_nr + j < unsigned(payload_node_count));
+               payload_last_use_ip[node_nr + j] = use_ip;
             }
          }
       }
-- 
2.11.0



More information about the mesa-dev mailing list