public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed][AArch64] Fix PR80671
@ 2017-05-10 11:40 Wilco Dijkstra
  0 siblings, 0 replies; only message in thread
From: Wilco Dijkstra @ 2017-05-10 11:40 UTC (permalink / raw)
  To: GCC Patches; +Cc: nd

Move an use-after-free access before the delete.

Committed as obvious.

ChangeLog:

2017-05-10  Wilco Dijkstra  <wdijkstr@arm.com>

	PR target/80671
	* config/aarch64/cortex-a57-fma-steering.c (merge_forest):
	Move member access before delete.
--
diff --git a/gcc/config/aarch64/cortex-a57-fma-steering.c b/gcc/config/aarch64/cortex-a57-fma-steering.c
index 4a3887984b4a0242b8a10bec0c6285ba184517ab..94d7f9c58692a417cba01720a7f05ec12b323c85 100644
--- a/gcc/config/aarch64/cortex-a57-fma-steering.c
+++ b/gcc/config/aarch64/cortex-a57-fma-steering.c
@@ -411,9 +411,9 @@ fma_forest::merge_forest (fma_forest *other_forest)
      the list of tree roots of ref_forest.  */
   this->m_globals->remove_forest (other_forest);
   this->m_roots->splice (this->m_roots->begin (), *other_roots);
-  delete other_forest;
-
   this->m_nb_nodes += other_forest->m_nb_nodes;
+
+  delete other_forest;
 }
 
 /* Dump information about the forest FOREST.  */

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

only message in thread, other threads:[~2017-05-10 11:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 11:40 [Committed][AArch64] Fix PR80671 Wilco Dijkstra

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).