Skip to content

Commit e3e1e5e

Browse files
committed
Fix almost-unreachable use-after-free.
1 parent 129c5ba commit e3e1e5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eh_personality.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,10 +735,11 @@ OBJC_PUBLIC void objc_exception_rethrow(struct _Unwind_Exception *e)
735735
// rethrown exception in objc_end_catch
736736
ex->catch_count = -ex->catch_count;
737737
_Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(e);
738+
id object = ex->object;
738739
free(ex);
739740
if (_URC_END_OF_STACK == err && 0 != _objc_unexpected_exception)
740741
{
741-
_objc_unexpected_exception(ex->object);
742+
_objc_unexpected_exception(object);
742743
}
743744
abort();
744745
}

0 commit comments

Comments
 (0)