mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
vc4: 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
baa4fefe74
commit
0b0d6a36f2
1 changed files with 1 additions and 4 deletions
|
|
@ -738,10 +738,7 @@ void
|
|||
qir_compile_destroy(struct vc4_compile *c)
|
||||
{
|
||||
qir_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) {
|
||||
qir_remove_instruction(c, qinst);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue