Move an use-after-free access before the delete.
authorWilco Dijkstra <wdijkstr@arm.com>
Wed, 10 May 2017 11:01:26 +0000 (11:01 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Wed, 10 May 2017 11:01:26 +0000 (11:01 +0000)
    gcc/
PR target/80671
* config/aarch64/cortex-a57-fma-steering.c (merge_forest):
Move member access before delete.

From-SVN: r247831

gcc/ChangeLog
gcc/config/aarch64/cortex-a57-fma-steering.c

index 454203cde920d96859e86f8b4986a1794d9d7eb9..30a8202aafc78ea6e111729ec19d44f45eaf2834 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2017-05-10  Alexandre Oliva <aoliva@redhat.com>
 
        * tree-inline.c (expand_call_inline): Split block at stmt
index 4a3887984b4a0242b8a10bec0c6285ba184517ab..94d7f9c58692a417cba01720a7f05ec12b323c85 100644 (file)
@@ -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.  */