public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6336] Fortran: frontend passes do_subscript leaks gmp memory [PR108924]
@ 2023-02-24 20:30 Harald Anlauf
  0 siblings, 0 replies; only message in thread
From: Harald Anlauf @ 2023-02-24 20:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:45f406c4f62e516b58dcda20b5a7aa43ff0aa0f3

commit r13-6336-g45f406c4f62e516b58dcda20b5a7aa43ff0aa0f3
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Fri Feb 24 19:56:32 2023 +0100

    Fortran: frontend passes do_subscript leaks gmp memory [PR108924]
    
    gcc/fortran/ChangeLog:
    
            PR fortran/108924
            * frontend-passes.cc (do_subscript): Clear used gmp variable.

Diff:
---
 gcc/fortran/frontend-passes.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc
index 02fcb41dbc4..90428982023 100644
--- a/gcc/fortran/frontend-passes.cc
+++ b/gcc/fortran/frontend-passes.cc
@@ -2883,7 +2883,10 @@ do_subscript (gfc_expr **e)
 		have_do_end = false;
 
 	      if (!have_do_start && !have_do_end)
-		return 0;
+		{
+		  mpz_clear (do_step);
+		  return 0;
+		}
 
 	      /* No warning inside a zero-trip loop.  */
 	      if (have_do_start && have_do_end)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-24 20:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24 20:30 [gcc r13-6336] Fortran: frontend passes do_subscript leaks gmp memory [PR108924] Harald Anlauf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).