mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
broadcom/compiler: don't use VLA on emit alu
Using constant-size array instead of variable-length array is preferred due several issues with the latter. Particularly, for this case using VLA generates several warnings by static analyzer: passed-by-value struct argument contains uninitialized data (e.g., field: 'file'). Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34050>
This commit is contained in:
parent
01151f045f
commit
0e50b09d4a
1 changed files with 2 additions and 1 deletions
|
|
@ -1375,7 +1375,8 @@ ntq_emit_alu(struct v3d_compile *c, nir_alu_instr *instr)
|
|||
}
|
||||
|
||||
/* General case: We can just grab the one used channel per src. */
|
||||
struct qreg src[nir_op_infos[instr->op].num_inputs];
|
||||
assert(nir_op_infos[instr->op].num_inputs <= 3);
|
||||
struct qreg src[3] = { 0 };
|
||||
for (int i = 0; i < nir_op_infos[instr->op].num_inputs; i++) {
|
||||
src[i] = ntq_get_alu_src(c, instr, i);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue