mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
glsl: don't leak memory when trying to count loop iterations
Suggested-by: Damian Dixon <damian.dixon@gmail.com> Reviewed-by: Elie Tournier <elie.tournier@collabora.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99789
This commit is contained in:
parent
1d5f4f46da
commit
40bc1afc94
1 changed files with 3 additions and 2 deletions
|
|
@ -97,9 +97,10 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
|
|||
new(mem_ctx) ir_expression(ir_binop_div, sub->type, sub, increment);
|
||||
|
||||
ir_constant *iter = div->constant_expression_value();
|
||||
|
||||
if (iter == NULL)
|
||||
if (iter == NULL) {
|
||||
ralloc_free(mem_ctx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!iter->type->is_integer()) {
|
||||
const ir_expression_operation op = iter->type->is_double()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue