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:
@@ -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);
|
new(mem_ctx) ir_expression(ir_binop_div, sub->type, sub, increment);
|
||||||
|
|
||||||
ir_constant *iter = div->constant_expression_value();
|
ir_constant *iter = div->constant_expression_value();
|
||||||
|
if (iter == NULL) {
|
||||||
if (iter == NULL)
|
ralloc_free(mem_ctx);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!iter->type->is_integer()) {
|
if (!iter->type->is_integer()) {
|
||||||
const ir_expression_operation op = iter->type->is_double()
|
const ir_expression_operation op = iter->type->is_double()
|
||||||
|
Reference in New Issue
Block a user