projects
/
platform
/
upstream
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d5f4f4
)
glsl: don't leak memory when trying to count loop iterations
author
Timothy Arceri
<tarceri@itsqueeze.com>
Fri, 17 Mar 2017 10:53:35 +0000
(21:53 +1100)
committer
Timothy Arceri
<tarceri@itsqueeze.com>
Sat, 18 Mar 2017 03:12:40 +0000
(14:12 +1100)
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
src/compiler/glsl/loop_controls.cpp
patch
|
blob
|
history
diff --git
a/src/compiler/glsl/loop_controls.cpp
b/src/compiler/glsl/loop_controls.cpp
index
c717605
..
fa739af
100644
(file)
--- a/
src/compiler/glsl/loop_controls.cpp
+++ b/
src/compiler/glsl/loop_controls.cpp
@@
-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()