This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] eval.c:evaluate_subexp_standard: Use RAII to avoid leaks
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Wed, 20 Sep 2017 19:57:10 -0400
- Subject: [binutils-gdb] eval.c:evaluate_subexp_standard: Use RAII to avoid leaks
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT c83833f49353e1fe7fa727291210be751161ade1 ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: c83833f49353e1fe7fa727291210be751161ade1
eval.c:evaluate_subexp_standard: Use RAII to avoid leaks
While working on the no-debug-info debugging improvements series, I
noticed these bare xfree calls, which lead to leaks if
evaluate_subexp_standard throws.
Fix that by reworking make_params as a RAII class. Ends up
eliminating a couple heap allocations too.
gdb/ChangeLog:
2017-09-20 Pedro Alves <palves@redhat.com>
* eval.c (make_params): Delete, refactored as ...
(class fake_method): ... this new type's ctor.
(fake_method::~fake_method): New.
(evaluate_subexp_standard): Use 'fake_method'.
- Follow-Ups:
- Failures on Fedora-s390x-m64, branch master
- Failures on Fedora-i686, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Ubuntu-AArch32-m32, branch master
- Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, branch master
- Failures on Ubuntu-AArch32-native-gdbserver-m32, branch master