Use of unsigned loop control variable with '>= 0' would lead to infinite loop.
Reported by clang:
etnaviv_compiler.c:1024:39: warning: comparison of unsigned expression >= 0 is
always true [-Wtautological-compare]
for (unsigned sp = c->frame_sp; sp >= 0; sp--)
~~ ^ ~
Signed-off-by: Rhys Kidd <[email protected]>
---
src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
I compile tested etnaviv but have not functionally tested on real hardware.
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index 59e1452..f1c6787 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -1021,7 +1021,7 @@ label_mark_use(struct etna_compile *c, struct
etna_compile_label *label)
static struct etna_compile_frame *
find_frame(struct etna_compile *c, enum etna_compile_frame_type type)
{
- for (unsigned sp = c->frame_sp; sp >= 0; sp--)
+ for (unsigned sp = c->frame_sp + 1; sp-- > 0 ; )
if (c->frame_stack[sp].type == type)
return &c->frame_stack[sp];
--
2.9.3
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev