From: Jakub Jelinek Date: Fri, 18 Oct 2019 17:18:21 +0000 (+0200) Subject: re PR middle-end/92153 (ICE / segmentation fault, use-after-free at gcc/ggc-page... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e0d2031c32b748eaf3ea89082c0f8658edcbf82;p=gcc.git re PR middle-end/92153 (ICE / segmentation fault, use-after-free at gcc/ggc-page.c:1159) PR middle-end/92153 * ggc-page.c (release_pages): Read g->alloc_size before free rather than after it. From-SVN: r277157 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dda2718a7a0..724ce8e25c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-10-18 Jakub Jelinek + + PR middle-end/92153 + * ggc-page.c (release_pages): Read g->alloc_size before free rather + than after it. + 2019-10-18 Andre Vieira * config/arm/t-multilib: Add rule to regenerate mutlilib header file diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 4560206ac2e..a18d7a9d826 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -1155,8 +1155,8 @@ release_pages (void) { *gp = g->next; G.bytes_mapped -= g->alloc_size; - free (g->allocation); n1 += g->alloc_size; + free (g->allocation); } else gp = &g->next;