[PATCH] Fix accesses to freed up memory in var-tracking (PR debug/53706)
Jakub Jelinek
jakub@redhat.com
Thu Jun 21 06:52:00 GMT 2012
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
More information about the Gcc-patches
mailing list