-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix throwing nil exceptions. #4
Conversation
{ | ||
assert(nil == x); | ||
caught_exception = YES; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the correct behaviour for, throwing nil
and catching (for example)NSObject *
? Should nil
also be caught by void*
catches in Objective-C++ (this case used to crash the Apple runtime, not sure if they've fixed it now)?
Conflicts: Test/CMakeLists.txt
It is only caught by
I've checked and it's not caught by a void* handler on 10.10.5 (it doesn't crash either, fwiw). |
The stand-alone code may be interacting oddly with the CXXException.mm stuff in -base, which attempts to box C++ exceptions as Objective-C objects. We should probably remove that now - it was largely a work-around for the fact that we didn't have working Objective-C++. |
Fix throwing nil exceptions.
The following is perfectly legal on Mac OS X:
It doesn't work presently because we were trying to dereference the object pointer to determine the class.