diff options
author | Tom Tromey <tom@tromey.com> | 2017-08-05 16:40:56 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-08-09 12:32:06 -0600 |
commit | 42fa2e0e1b7b135ab30f2f78074c3bfffa04d0cc (patch) | |
tree | f70f2f955f5a331bec0f8ffd02858908c96cbf99 /ld/testsuite/ld-x86-64 | |
parent | cc4a945a2687184c7cd4a0572e02965829517408 (diff) | |
download | gdb-42fa2e0e1b7b135ab30f2f78074c3bfffa04d0cc.zip gdb-42fa2e0e1b7b135ab30f2f78074c3bfffa04d0cc.tar.gz gdb-42fa2e0e1b7b135ab30f2f78074c3bfffa04d0cc.tar.bz2 |
C++-ify skip.c
I happened to notice that skiplist_entry, in skip.c, contains a
gdb::optional<compiled_regex> -- but that this object's destructor is
never run. This can result in a memory leak.
This patch fixes the bug by applying a bit more C++: changing this
code to use new and delete, and std::unique_ptr; and removing cleanups
in the process.
Built and regression tested on x86-64 Fedora 25.
ChangeLog
2017-08-09 Tom Tromey <tom@tromey.com>
* skip.c (skiplist_entry): New constructor.
(skiplist_entry::enabled, skiplist_entry::function_is_regexp)
(skiplist_entry::file_is_glob): Now bool.
(skiplist_entry::file, skiplist_entry::function): Now
std::string.
(make_skip_entry): Return a unique_ptr. Use new.
(free_skiplist_entry, free_skiplist_entry_cleanup)
(make_free_skiplist_entry_cleanup): Remove.
(skip_command, skip_disable_command, add_skiplist_entry)
(skip_form_bytes, compile_skip_regexp, skip_command, skip_info)
(skip_file_p, skip_gfile_p, skip_function_p, skip_rfunction_p)
(function_name_is_marked_for_skip): Update.
(skip_delete_command): Update. Use delete.
Diffstat (limited to 'ld/testsuite/ld-x86-64')
0 files changed, 0 insertions, 0 deletions