This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix accesses to freed up memory in var-tracking (PR debug/53706)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Alexandre Oliva <aoliva at redhat dot com>
- Date: Thu, 21 Jun 2012 08:15:38 +0200
- Subject: [PATCH] Fix accesses to freed up memory in var-tracking (PR debug/53706)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
During htab_delete (dropped_values), loc_exp_dep_pool
allocated objects might be accessed, so it is better to free the
pool afterwards.
Bootstrapped/regtested on i686-linux, ok for trunk?
2012-06-21 Jakub Jelinek <jakub@redhat.com>
PR debug/53706
* var-tracking.c (vt_emit_notes): Free loc_exp_dep_pool
only after htab_delete call.
--- gcc/var-tracking.c.jj 2012-06-14 20:26:02.000000000 +0200
+++ gcc/var-tracking.c 2012-06-18 09:02:56.142742617 +0200
@@ -9127,9 +9127,9 @@ vt_emit_notes (void)
if (MAY_HAVE_DEBUG_INSNS)
{
+ htab_delete (dropped_values);
free_alloc_pool (loc_exp_dep_pool);
loc_exp_dep_pool = NULL;
- htab_delete (dropped_values);
}
emit_notes = false;
Jakub