mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
etnaviv: Avoid infinite loop in find_frame()
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--)
~~ ^ ~
v2: Simply use the same datatype as c->frame_sp is using.
CC: <mesa-stable@lists.freedesktop.org>
Reported-by: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rhys Kidd <rhyskidd@gmail.com>
(cherry picked from commit 82fe240a99)
This commit is contained in:
parent
9ecfbafedb
commit
f3b7a51383
1 changed files with 1 additions and 1 deletions
|
|
@ -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 (int sp = c->frame_sp; sp >= 0; sp--)
|
||||
if (c->frame_stack[sp].type == type)
|
||||
return &c->frame_stack[sp];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue