projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
77a00c7
)
glsl: Add null check in loop_analysis.cpp
author
Juha-Pekka Heikkila
<juhapekka.heikkila@gmail.com>
Thu, 3 Apr 2014 13:51:14 +0000
(16:51 +0300)
committer
Tapani Pälli
<tapani.palli@intel.com>
Fri, 30 May 2014 04:21:12 +0000
(07:21 +0300)
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>
src/glsl/loop_analysis.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/loop_analysis.cpp
b/src/glsl/loop_analysis.cpp
index d6a9ac775609d4658b0f69f282fb5807f3b91e52..78ac30044adba98668edb20ac928eafd0d2de065 100644
(file)
--- 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;
}