diff options
Diffstat (limited to 'libobjc/exception.c')
-rw-r--r-- | libobjc/exception.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libobjc/exception.c b/libobjc/exception.c index cfce70c51e3..e1de2ae5af1 100644 --- a/libobjc/exception.c +++ b/libobjc/exception.c @@ -15,8 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting @@ -165,7 +165,8 @@ PERSONALITY_FUNCTION (int version, const unsigned char *p; _Unwind_Ptr landing_pad, ip; int handler_switch_value; - int saw_cleanup, saw_handler; + int saw_cleanup = 0, saw_handler; + void *return_object; /* Interface version check. */ if (version != 1) @@ -334,8 +335,15 @@ PERSONALITY_FUNCTION (int version, } install_context: + if (saw_cleanup == 0) + { + return_object = xh->value; + if (!(actions & _UA_SEARCH_PHASE)) + _Unwind_DeleteException(&xh->base); + } + _Unwind_SetGR (context, __builtin_eh_return_data_regno (0), - __builtin_extend_pointer (xh->value)); + __builtin_extend_pointer (saw_cleanup ? xh : return_object)); _Unwind_SetGR (context, __builtin_eh_return_data_regno (1), handler_switch_value); _Unwind_SetIP (context, landing_pad); |