mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
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:
parent
77a00c71bb
commit
19f1d137f8
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue