mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
v3d: avoid 0-size variable length array
Declaring a variable-length array (VLA) based on a variable that can be 0 is declared dangerous. In this case, the variable can't take value 0, so adding an assertion fixes the issue. This was detected by static analyzer. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32819>
This commit is contained in:
parent
f94bd67b82
commit
0d14e129bc
1 changed files with 2 additions and 0 deletions
|
|
@ -267,6 +267,8 @@ get_spill_type_for_temp(struct v3d_compile *c, int temp)
|
|||
static int
|
||||
v3d_choose_spill_node(struct v3d_compile *c)
|
||||
{
|
||||
assert(c->num_temps > 1);
|
||||
|
||||
const float tmu_scale = 10;
|
||||
float block_scale = 1.0;
|
||||
float spill_costs[c->num_temps];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue