glsl: Add null check in loop_analysis.cpp

Check return value from hash_table_find before using it as a pointer

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Juha-Pekka Heikkila 2014-04-03 16:51:14 +03:00 committed by Tapani Pälli
parent 77a00c71bb
commit 19f1d137f8

View file

@ -589,8 +589,10 @@ get_basic_induction_increment(ir_assignment *ir, hash_table *var_hash)
loop_variable *lv =
(loop_variable *) hash_table_find(var_hash, inc_var);
if (!lv->is_loop_constant())
inc = NULL;
if (lv == NULL || !lv->is_loop_constant()) {
assert(lv != NULL);
inc = NULL;
}
} else
inc = NULL;
}