aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2019-02-12 14:02:48 +0100
committerTom Tromey <tromey@gcc.gnu.org>2019-02-12 13:02:48 +0000
commitf9f75f8d3cc4afb77c2e75c1e786810cdca920c3 (patch)
treebc94a11a30f45a52486ce30aeb3b950e48f9d1f4 /gcc/ipa-pure-const.c
parentc4d5763224c7817ad5cb671e651e69b2708d49f0 (diff)
downloadgcc-f9f75f8d3cc4afb77c2e75c1e786810cdca920c3.zip
gcc-f9f75f8d3cc4afb77c2e75c1e786810cdca920c3.tar.gz
gcc-f9f75f8d3cc4afb77c2e75c1e786810cdca920c3.tar.bz2
Fix splay tree KEY leak detected in GDB test gdb.base/macscp.exp
When a node is removed from a splay tree, the splay tree was not using the function splay_tree_delete_key_fn to release the key. This was causing a leak, fixed by Tom Tromey. This patch fixes another key leak, that happens when a key equal to a key already present is inserted. In such a case, we have to release the old KEY. Note that this is based on the assumption that the caller always allocates a new KEY when doing an insert. Also, clarify the documentation about when the release functions are called. 2019-02-11 Philippe Waroquiers <philippe.waroquiers@skynet.be> * splay-tree.h (splay_tree_delete_key_fn): Update comment. (splay_tree_delete_value_fn): Likewise. libiberty/ChangeLog 2019-02-11 Philippe Waroquiers <philippe.waroquiers@skynet.be> * splay-tree.c (splay_tree_insert): Also release old KEY in case of insertion of a key equal to an already present key. (splay_tree_new_typed_alloc): Update comment. From-SVN: r268793
Diffstat (limited to 'gcc/ipa-pure-const.c')
0 files changed, 0 insertions, 0 deletions