[committed] Fortran: fix FE memleak with BOZ expressions
Checks
Commit Message
Dear all,
while looking at variations of testcases in pr107560, I discovered
a minor FE memleak that was introduced in the BOZ rework and is
fixed by the attached simple patch.
Regtested on x86_64-pc-linux-gnu on OK'ed in the PR by Steve.
Thanks,
Harald
From 833233a4aefc9981b671c1bda34676c20b76cc90 Mon Sep 17 00:00:00 2001
From: Harald Anlauf <anlauf@gmx.de>
Date: Fri, 24 Mar 2023 22:07:37 +0100
Subject: [PATCH] Fortran: fix FE memleak with BOZ expressions.
gcc/fortran/ChangeLog:
* expr.cc (free_expr0): Free also BOZ strings as part of an expression.
---
gcc/fortran/expr.cc | 4 ++++
1 file changed, 4 insertions(+)
@@ -466,6 +466,10 @@ free_expr0 (gfc_expr *e)
mpc_clear (e->value.complex);
break;
+ case BT_BOZ:
+ free (e->boz.str);
+ break;
+
default:
break;
}
--
2.35.3