icf: Fix memory leak of a vector.

Message ID b2acd5a0-3098-8e75-313b-86f2a14b1f22@suse.cz
State New
Headers show
Series
  • icf: Fix memory leak of a vector.
Related show

Commit Message

Martin Liška June 1, 2021, 2:28 p.m.
Simple leak fix.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

	* ipa-icf.h: Use auto_vec for memory_access_types.
---
  gcc/ipa-icf.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.31.1

Comments

Bill Schmidt via Gcc-patches June 1, 2021, 5:53 p.m. | #1
On 6/1/2021 8:28 AM, Martin Liška wrote:
> Simple leak fix.

>

> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

>

> Ready to be installed?

> Thanks,

> Martin

>

> gcc/ChangeLog:

>

>     * ipa-icf.h: Use auto_vec for memory_access_types.

OK
jeff

Patch

diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
index 9f21a2018fc..4b4d4924512 100644
--- a/gcc/ipa-icf.h
+++ b/gcc/ipa-icf.h
@@ -372,7 +372,7 @@  public:
    hashval_t gcode_hash;
  
    /* Vector of subpart of memory access types.  */
-  vec<tree> memory_access_types;
+  auto_vec<tree> memory_access_types;
  
    /* Total number of SSA names used in the function.  */
    unsigned ssa_names_size;