mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-04 15:18:15 +02:00
r300: fix use-after-free of remap_table in rc_remove_unused_constants
When externals were not remapped, free(s->remap_table) ran before rc_constants_print. Print the constants first, then free. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41577>
This commit is contained in:
parent
d68b7e48da
commit
3740d12ba0
1 changed files with 3 additions and 3 deletions
|
|
@ -378,6 +378,9 @@ rc_remove_unused_constants(struct radeon_compiler *c, void *user)
|
|||
rc_constants_destroy(&c->Program.Constants);
|
||||
c->Program.Constants = s->new_constants;
|
||||
|
||||
if (c->Debug & RC_DBG_LOG)
|
||||
rc_constants_print(&c->Program.Constants, s->remap_table);
|
||||
|
||||
if (s->are_externals_remapped) {
|
||||
*out_remap_table = s->remap_table;
|
||||
} else {
|
||||
|
|
@ -387,7 +390,4 @@ rc_remove_unused_constants(struct radeon_compiler *c, void *user)
|
|||
|
||||
free(s->inv_remap_table);
|
||||
free(s->is_used_as_vector);
|
||||
|
||||
if (c->Debug & RC_DBG_LOG)
|
||||
rc_constants_print(&c->Program.Constants, s->remap_table);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue