mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 14:50:11 +01:00
broadcom/compiler: use safe iterator to remove instructions
The current approach has an issue detected by static analyzer: use of memory after it is freed. Using a proper iterator makes things safer. 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
0b0d6a36f2
commit
01151f045f
1 changed files with 1 additions and 4 deletions
|
|
@ -2197,10 +2197,7 @@ vir_compile_destroy(struct v3d_compile *c)
|
|||
c->cursor.link = NULL;
|
||||
|
||||
vir_for_each_block(block, c) {
|
||||
while (!list_is_empty(&block->instructions)) {
|
||||
struct qinst *qinst =
|
||||
list_first_entry(&block->instructions,
|
||||
struct qinst, link);
|
||||
list_for_each_entry_safe(struct qinst, qinst, &block->instructions, link) {
|
||||
vir_remove_instruction(c, qinst);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue