Mesa (master): glsl/loop_analysis: Don't search for NULL variables in the hash table

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 6 00:28:02 UTC 2019


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Jun  5 18:35:14 2019 -0500

glsl/loop_analysis: Don't search for NULL variables in the hash table

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/compiler/glsl/loop_analysis.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/glsl/loop_analysis.cpp b/src/compiler/glsl/loop_analysis.cpp
index e90eb1ccde5..4041a0f66ec 100644
--- a/src/compiler/glsl/loop_analysis.cpp
+++ b/src/compiler/glsl/loop_analysis.cpp
@@ -288,6 +288,9 @@ loop_state::get(const ir_loop *ir)
 loop_variable *
 loop_variable_state::get(const ir_variable *ir)
 {
+   if (ir == NULL)
+      return NULL;
+
    hash_entry *entry = _mesa_hash_table_search(this->var_hash, ir);
    return entry ? (loop_variable *) entry->data : NULL;
 }




More information about the mesa-commit mailing list