David Chisnall
aa775cf835
Fix ObjC++ interop bug.
...
The reworked wrapping of C++ exceptions meant that we were missing a
dereference of the result of __cxa_begin_catch.
Add a test that triggers this issue. It would have occurred in the
non-ARC version if we actually did anything with the exception, but
compiling it in ARC mode makes the compiler insert retain / autorelease
around the exception object to ensure that it remains live.
6 years ago
David Chisnall
242442b3aa
Rework Objective-C++ exceptions.
...
The new version now does not depend on the layout of the C++ exception
structure and instead finds the two offsets that it cares about.
Fixes #108
6 years ago
David Chisnall
50493c38d7
Don't use pthread storage for exceptions.
...
If an exception unwinds to the top of a thread, the process will die, so
don't worry about leaking memory for this case.
7 years ago
David Chisnall
2e6528e82b
Fix accidentally inverted preprocessor directive.
7 years ago
David Chisnall
acf44d64cb
Fix invalid preprocessor directives.
7 years ago
David Chisnall
088977679e
DWARF EH cleanups.
...
Update the C++ ABI for the C++11 ABI and fix the missing ARM-specific
bits. Work around a bug in ARM.
7 years ago
David Chisnall
abf629b1f7
Make some private symbols private.
7 years ago
David Chisnall
b81df02b91
Merge branch 'master' into newabi
...
Simplify the setSubclass dtable updating mechanism.
8 years ago
Dustin Howett
6af4fcb219
Fix eh_personality for NO_PTHREADS
8 years ago
David Chisnall
ea5f2920e8
Small cleanups.
...
Technically, this was undefined behaviour, but it probably worked on most targets.
8 years ago
David Chisnall
7bd78e5b46
Fix a bug in ObjC++ EH.
...
Throwing an Objective-C exception through a C++ catch block was broken.
This was because the C++ code inserts a cleanup handler to make sure
that it invokes `__cxa_end_catch`. Unwinding through this catchup
transformed the Objective-C exception into a C++ one. This case should
have been handled, except for two bugs:
1. A typo (`#ifdef` instead of `#ifndef`) meant that we were not
extracting the Objective-C exception from the C++ object.
2. We were skipping everything except catchalls after the search phase,
because we lose some information in the transformation.
Fixes #49
8 years ago
David Chisnall
42b78dba9b
(Hopefully) fix C++ exception interop on ARM.
10 years ago
Niels Grewe
b2e7c50704
Fix throwing nil exceptions.
10 years ago
theraven
a8fe7efdae
Make sure we continue unwinding correctly on ARM.
...
Patch by Logan Chien!
12 years ago
theraven
6317b79a10
Implemented the new exception ABI, and a load of tests for it. This is used by
...
clang trunk if -fobjc-runtime-1.7 is specified and provides significantly
better interoperability with foreign exceptions.
Note: Most of the exception tests will not pass with gcc or clang < 3.3. They
test things that are impossible to implement quite correctly with the
GCC-compatible exception ABI.
Also updated the release notes to reflect recent improvements.
13 years ago
theraven
c6eede8179
GCC-compatibility tweak in EH.
14 years ago
theraven
6cea966cad
Remove some accidentally-committed debug stuff.
14 years ago
theraven
9490b1b84e
Implement ARM EH support, fix objc_msgSend() to work on ARM.
14 years ago
theraven
8af52846b7
Small object (hidden in a pointer) support.
15 years ago
theraven
9ef84a982c
Remove redundant include.
15 years ago
theraven
6c7cf4a5a6
Add visibility attributes on all internal functions so that we aren't ever exporting them outside of libobjc.
15 years ago
theraven
600e970dea
Separate ObjC++ support out into libobjcxx. Now code that doesn't need ObjCXX support can safely ignore it again.
15 years ago
theraven
7e465eb325
Tweak building without ObjC++ support a bit.
15 years ago
theraven
3ccb4240cc
Fix getting Objective-C objects out of C++ exceptions.
15 years ago
theraven
e0719a9c62
Added Objective-C++ exception handling support. Allows throwing Objective-C objects with throw or @throw and catching them with catch() or @catch.
15 years ago
theraven
fc28010846
...but don't catch foreign exceptions in catch statements for the boxing class's superclass.
15 years ago
theraven
4e5578b0be
Allow boxed foreign exceptions to be caught in explicit catch statements.
15 years ago
theraven
d6455e2a65
More EH tweaks. New ABI now uses "@id" for id catches and NULL for catchalls. Code compiled with GCC and clang with the old ABI will continue to use NULL for catchalls and id catches, which means that C++ exceptions will be caught in their boxed form here and must be explicitly rethrown.
15 years ago
theraven
45c428f9a3
Allow the boxed exception object to rethrow itself, if it knows how. This means that a C++ function can throw a C++ object, we can box it in an ObjC object for passing through Objective-C stack frames, and then unbox it to catch it in C++ code.
15 years ago
theraven
943ed5e714
Some source tidies.
16 years ago
theraven
7ac0904a1f
Don't leak memory when throwing exceptions.
16 years ago
theraven
7d0d599241
Fix handling of cleanups while unwinding for exception throwing.
16 years ago
theraven
f4e7a7bf5c
Return the correct thing to exception handlers.
16 years ago
theraven
f375d20d7a
Add support for catching C++ (and Java / Ada) exceptions in Objective-C.
16 years ago
theraven
07758fe521
Removed last bits of legacy code from libobjc2. Added new exception handling implementation.
16 years ago