summaryrefslogtreecommitdiffstats
path: root/src/glsl/loop_analysis.cpp
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2014-04-03 16:51:14 +0300
committerTapani Pälli <[email protected]>2014-05-30 07:21:12 +0300
commit19f1d137f8d5edbbdef4e78186b21a7a5bd08d18 (patch)
treebda813e8ff5eb214f07a1cce089a96507858c01d /src/glsl/loop_analysis.cpp
parent77a00c71bb3ecaafc9ceec035937c02e75a505b6 (diff)
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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/loop_analysis.cpp')
-rw-r--r--src/glsl/loop_analysis.cpp6
1 files changed, 4 insertions, 2 deletions
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;
}