diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2017-05-25 15:10:01 +0000 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2017-05-25 15:10:01 +0000 |
commit | 5ff70e0b3487046a30f44de548d8c38d54fe2ceb (patch) | |
tree | 6db73f42b5d2272e5de00af2abf9ec3879dc7195 /gcc/config/aarch64 | |
parent | 5b9581a4cce6845b4bb668336d7cc50d7564396b (diff) |
Move an use-after-free access before the delete.
Backport from mainline
PR target/80671
* config/aarch64/cortex-a57-fma-steering.c (merge_forest):
Move member access before delete.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@248461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/aarch64')
-rw-r--r-- | gcc/config/aarch64/cortex-a57-fma-steering.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/aarch64/cortex-a57-fma-steering.c b/gcc/config/aarch64/cortex-a57-fma-steering.c index 4a3887984b4..94d7f9c5869 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. */ |