Mesa (master): i965: Don' t use the head sentinel as an fs_inst in Gen4 workaround code.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Jun 10 23:39:05 UTC 2014


Module: Mesa
Branch: master
Commit: ecc78eab119ac8fa3df380a80bc94975e986523c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ecc78eab119ac8fa3df380a80bc94975e986523c

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Jun  9 02:59:21 2014 -0700

i965: Don't use the head sentinel as an fs_inst in Gen4 workaround code.

When walking backwards, we want to stop at the head sentinel, which is
where scan_inst->prev->prev == NULL, not scan_inst->prev == NULL.

Fixes random crashes, as well as valgrind errors.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Cc: mesa-stable at lists.freedesktop.org

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index a8ca9bc..b485e65 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2355,7 +2355,7 @@ fs_visitor::insert_gen4_pre_send_dependency_workarounds(fs_inst *inst)
     * program.
     */
    for (fs_inst *scan_inst = (fs_inst *)inst->prev;
-        scan_inst != NULL;
+        !scan_inst->is_head_sentinel();
         scan_inst = (fs_inst *)scan_inst->prev) {
 
       /* If we hit control flow, assume that there *are* outstanding




More information about the mesa-commit mailing list