OSDN Git Service

glsl/loop_analysis: Don't search for NULL variables in the hash table
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 5 Jun 2019 23:35:14 +0000 (18:35 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Thu, 6 Jun 2019 00:27:53 +0000 (00:27 +0000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/loop_analysis.cpp

index e90eb1c..4041a0f 100644 (file)
@@ -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;
 }