Move an use-after-free access before the delete. Committed as obvious.
ChangeLog: 2017-05-10 Wilco Dijkstra <wdijk...@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. */