On 03/31/2017 12:01 AM, Nicolai Hähnle wrote:
On 31.03.2017 05:21, Brian Paul wrote:
To avoid/fix a segmentation fault when running the stand-alone GLSL
compiler utility for cases such as the Mesa demos toyball test:

glsl_compiler --dump-builder --version 120 CH11-toyball.vert
CH11-toyball.frag
---
 src/compiler/glsl/ir_builder_print_visitor.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp
b/src/compiler/glsl/ir_builder_print_visitor.cpp
index 825dbe1..164a237 100644
--- a/src/compiler/glsl/ir_builder_print_visitor.cpp
+++ b/src/compiler/glsl/ir_builder_print_visitor.cpp
@@ -581,7 +581,9 @@
ir_builder_print_visitor::print_without_declaration(const
ir_expression *ir)
          const struct hash_entry *const he =
             _mesa_hash_table_search(index_map, ir->operands[i]);

-         print_without_indent("r%04X", (unsigned)(uintptr_t) he->data);
+         if (he) {
+            print_without_indent("r%04X", (unsigned)(uintptr_t)
he->data);
+         }

Is the output still usable in this case? I don't quite understand the
use case and how this case can happen.

I didn't dig either and would appreciate any feedback. I'm merely trying to avoid a segfault (found while debugging the MinGW optimization issue).

-Brian

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to