aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2014-05-14 14:18:49 +0000
committerGary Benson <gary@gcc.gnu.org>2014-05-14 14:18:49 +0000
commit70c8c2b93243e68161ed133ef6e6d1c7170b2b98 (patch)
treea324a1d40a7180cc42f0d41ed5ade6965c6f04eb /libiberty
parenta3f58be687bf7db8033ab77cc65e6b8c7b50911e (diff)
downloadgcc-70c8c2b93243e68161ed133ef6e6d1c7170b2b98.zip
gcc-70c8c2b93243e68161ed133ef6e6d1c7170b2b98.tar.gz
gcc-70c8c2b93243e68161ed133ef6e6d1c7170b2b98.tar.bz2
cplus-dmem.c (internal_cplus_demangle): Free any resources allocated by possible previous call to gnu_special.
libiberty/ 2014-05-14 Andrew Burgess <aburgess@broadcom.com> * cplus-dmem.c (internal_cplus_demangle): Free any resources allocated by possible previous call to gnu_special. (squangle_mop_up): Reset pointers to NULL after calling free. * testsuite/demangle-expected: New test case. From-SVN: r210425
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog7
-rw-r--r--libiberty/cplus-dem.c7
-rw-r--r--libiberty/testsuite/demangle-expected4
3 files changed, 18 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 335a47d..7156be7 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,10 @@
+2014-05-14 Andrew Burgess <aburgess@broadcom.com>
+
+ * cplus-dmem.c (internal_cplus_demangle): Free any resources
+ allocated by possible previous call to gnu_special.
+ (squangle_mop_up): Reset pointers to NULL after calling free.
+ * testsuite/demangle-expected: New test case.
+
2014-05-08 Gary Benson <gbenson@redhat.com>
* cp-demangle.c (struct d_component_stack): New structure.
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index e948487..2dd0a8a 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -1175,6 +1175,11 @@ internal_cplus_demangle (struct work_stuff *work, const char *mangled)
if ((AUTO_DEMANGLING || GNU_DEMANGLING))
{
success = gnu_special (work, &mangled, &decl);
+ if (!success)
+ {
+ delete_work_stuff (work);
+ string_delete (&decl);
+ }
}
if (!success)
{
@@ -1218,10 +1223,12 @@ squangle_mop_up (struct work_stuff *work)
if (work -> btypevec != NULL)
{
free ((char *) work -> btypevec);
+ work->btypevec = NULL;
}
if (work -> ktypevec != NULL)
{
free ((char *) work -> ktypevec);
+ work->ktypevec = NULL;
}
}
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 453f9a3..823a1c4 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4343,3 +4343,7 @@ cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::p
--format=gnu-v3
_ZNSt9_Any_data9_M_accessIPZ4postISt8functionIFvvEEEvOT_EUlvE_EERS5_v
void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std::_Any_data::_M_access<void post<std::function<void ()> >(void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16817
+--format=auto --no-params
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z