[Mesa-dev] [PATCH 1/2] i965/fs: Add missing null checks in fs_generator::generate_assembly()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Fri May 30 03:54:47 PDT 2014


In fs_generator::generate_assembly() was avoided null access when
fetching variable prog but then prog was left null and used
as pointer.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 6ba8bb9..28f6ab6 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -1789,7 +1789,7 @@ fs_generator::generate_assembly(exec_list *simd8_instructions,
       generate_code(simd8_instructions, &annotation);
       brw_compact_instructions(p, 0, annotation.ann_count, annotation.ann);
 
-      if (unlikely(debug_flag)) {
+      if (unlikely(debug_flag) && prog != NULL) {
          dump_assembly(p->store, annotation.ann_count, annotation.ann,
                        brw, prog, brw_disassemble);
          ralloc_free(annotation.ann);
@@ -1815,7 +1815,7 @@ fs_generator::generate_assembly(exec_list *simd8_instructions,
       brw_compact_instructions(p, prog_data->prog_offset_16,
                                annotation.ann_count, annotation.ann);
 
-      if (unlikely(debug_flag)) {
+      if (unlikely(debug_flag) && prog != NULL) {
          dump_assembly(p->store, annotation.ann_count, annotation.ann,
                        brw, prog, brw_disassemble);
          ralloc_free(annotation.ann);
-- 
1.8.1.2



More information about the mesa-dev mailing list