From: Juha-Pekka Heikkila Date: Thu, 3 Apr 2014 13:51:14 +0000 (+0300) Subject: glsl: Add null check in loop_analysis.cpp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19f1d137f8d5edbbdef4e78186b21a7a5bd08d18;p=mesa.git 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 Reviewed-by: Ian Romanick --- diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp index d6a9ac77560..78ac30044ad 100644 --- a/src/glsl/loop_analysis.cpp +++ b/src/glsl/loop_analysis.cpp @@ -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; }