cplus-demangler, free resource after a failed call to gnu_special.
authorAndrew Burgess <aburgess@broadcom.com>
Wed, 28 May 2014 22:06:43 +0000 (23:06 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 28 May 2014 22:06:43 +0000 (23:06 +0100)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210425 138bc75d-0d04-0410-961f-82ee72b054a4

libiberty/ChangeLog
libiberty/cplus-dem.c
libiberty/testsuite/demangle-expected

index 335a47db3c287a1557e28a41e2987688772c69eb..7156be71830837f25ec16eb86353375d7d266e36 100644 (file)
@@ -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.
index e94848767e780847ca9e4bd6f879906c72d99fcf..2dd0a8a5c8451e22852f91afdc221579e91b780e 100644 (file)
@@ -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;
     }
 }
 
index 453f9a381b600ac0eb9bcc5102aba8cae9a84f89..823a1c4e21083fa56e0118d6f90a56feef4ccd85 100644 (file)
@@ -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
This page took 0.031391 seconds and 4 git commands to generate.