Hi David!

On 10 Feb 2009, at 16:14, David Chisnall wrote:
> Non-local returns can indeed be implemented in terms of exceptions -
> they are.  LanguageKit uses the standard exception handling mechanism
> for them, but a different personality function.  They should therefore
> not interfere with Objective-C (or C++) exceptions.

Oh, cool. I wasn't aware of this. That sounds very good then. :-)

> If you are using setjmp()/longjmp() exceptions, then I have no idea
> what will happen, but it's probably going to be a mess.  The old style
> exceptions do not have any equivalent of @finally, they are
> responsible for making sure that everything is autoreleased as soon as
> it is used.

This is interesting. Is -fnative-exceptions the default on GNUstep? I  
have actually no idea what I'm using. If it's possible to still  
compile GNUstep with setjmp/longjmp exception handling, maybe we  
should figure out a way to check it and emit warnings somewhere.

> Your example should work.  You are not correct in your assertion that
> NS_VALUERETURN is needed in NS_HANDLER blocks - using it here is
> incorrect and may corrupt the exception handler stack.  By the time
> the do: block is run, the jump buffer should have already been popped
> from the stack.  You will, however, encounter a problem if you do
> something like this:

Then I'll revert the change from r4117, where the NS_VALUERETURN in  
the handler block was introduced in -[BlockClosure onException:do:].

Best regards,
Günther


_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to