From: Mark Wielaard Date: Tue, 1 Feb 2011 10:10:09 +0000 (+0100) Subject: Remove unused try-catch-throw blocks. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c651d9058ba1066dc05a059fda6d1d456dc932a4;p=thirdparty%2Felfutils.git Remove unused try-catch-throw blocks. There isn't any "recatcher" of these throws, so the only thing the cleanup does is hide the original exception in case of error, making debugging the root cause harder. --- diff --git a/libdw/c++/dwarf_edit b/libdw/c++/dwarf_edit index e7ed54e12..854c27695 100644 --- a/libdw/c++/dwarf_edit +++ b/libdw/c++/dwarf_edit @@ -164,22 +164,11 @@ namespace elfutils template inline void set (const die_type &die, arg_type &arg) { - try - { - _m_tag = die.tag (); - attributes_type t_attrs (die.attributes (), arg); - _m_attributes.swap (t_attrs); - children_type t_children (die.children (), arg); - _m_children.swap (t_children); - } - catch (...) - { - // Never leave a partially-formed DIE. - _m_tag = -1; - _m_attributes.clear (); - _m_children.clear (); - throw; - }; + _m_tag = die.tag (); + attributes_type t_attrs (die.attributes (), arg); + _m_attributes.swap (t_attrs); + children_type t_children (die.children (), arg); + _m_children.swap (t_children); } public: diff --git a/libdw/c++/dwarf_output b/libdw/c++/dwarf_output index 04ace9646..8b14c6c51 100644 --- a/libdw/c++/dwarf_output +++ b/libdw/c++/dwarf_output @@ -1875,21 +1875,13 @@ namespace elfutils assert (_m_in->_m_pending == NULL); _m_in->_m_pending = _m_out; - try - { - // This calls add_reference for each pending reference. - _m_out->_m_attributes.set (in.attributes (), *this); + // This calls add_reference for each pending reference. + _m_out->_m_attributes.set (in.attributes (), *this); - for (input_die_ptr i = in.children ().begin (); - i != in.children ().end (); - ++i) - add_child (*i); - } - catch (...) - { - _m_in->_m_pending = NULL; - throw; - } + for (input_die_ptr i = in.children ().begin (); + i != in.children ().end (); + ++i) + add_child (*i); _m_out = NULL; _m_in->defined_self (_m_copier);