Re: [PATCH v1] tools/libs/guest: assist gcc13's realloc analyzer

2023-04-24 Thread Jason Andryuk
On Wed, Apr 19, 2023 at 8:55 AM Juergen Gross wrote: > > On 19.04.23 12:06, Olaf Hering wrote: > > gcc13 fails to track the allocated memory in backup_ptes: > > > > xg_offline_page.c: In function 'backup_ptes': > > xg_offline_page.c:191:13: error: pointer 'orig' may be used after 'realloc' > > [-

Re: [PATCH v1] tools/libs/guest: assist gcc13's realloc analyzer

2023-04-19 Thread Juergen Gross
On 19.04.23 12:06, Olaf Hering wrote: gcc13 fails to track the allocated memory in backup_ptes: xg_offline_page.c: In function 'backup_ptes': xg_offline_page.c:191:13: error: pointer 'orig' may be used after 'realloc' [-Werror=use-after-free] 191 | free(orig); Assist the analyze

[PATCH v1] tools/libs/guest: assist gcc13's realloc analyzer

2023-04-19 Thread Olaf Hering
gcc13 fails to track the allocated memory in backup_ptes: xg_offline_page.c: In function 'backup_ptes': xg_offline_page.c:191:13: error: pointer 'orig' may be used after 'realloc' [-Werror=use-after-free] 191 | free(orig); Assist the analyzer by slightly rearranging the code: In ca