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 e90eb1ccde5a028bb07c8b285f7f41bae7ca8316..4041a0f66ecc7e1707391f6d2fef5e9d269a25a8 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;
 }