Changes

Jump to: navigation, search

Obj-C Exceptions In Gecko

392 bytes added, 18:55, 14 February 2008
added a couple bits
This page is written for the people doing the original wrapping implementation for now.
The basic problem we have is that almost every call into any of Apple's framework frameworks (C , C++, or Obj-C) could potentially throw an Obj-C exception and unwind our stack with nasty consequences. Sometimes the browser crashes, sometimes it just appears to have lost its mind, and theoretically there could be security consequences. This is because we have no handlers in place now and as the stack unwinds code gets skipped and C++ temporary objects do not get their destructors run.
You can read more about it in the bug, but the conclusion we came to is that we need to wrap all calls into Apple frameworks with Obj-C exception handlers. This means Carbon, Cocoa, Quicktime, printing, etc. The only known exceptions are standard C and C++ library functions, Unix/Posix functions, and low-level Mach calls.
I have checked in a set of macros for doing that, see this file:
-Josh Aas
 
Note that -fobjc-extensions needs to be passed to the compiler. This is already being done for widget/src/cocoa; a forthcoming patch will ensure that it gets passed to all .m and .mm files in the tree.
 
-Stan
20
edits

Navigation menu