This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Exception propagation ffi_call


Hi,

I am using libffi for an Objective-c Application framework that I am writing. It seems the exception are getting lost in the ffi_call.

This is my source:

void clothureMethod(ffi_cif *cif, void* ret, void* args[], void* userData) {
	@try {
		for (id<IMessageBeforeAdvice> advice in beforeAdvices) {
			[advice beforeInvocation:methodName 
						  withTarget:(__bridge id)target];
		}
		
		ffi_call(cif, FFI_FN(originalImplementation), ret, args);
		
		for (id<IMessageAfterAdvice> advice in afterAdvices) {
			[advice afterInvocation:methodName 
						 withTarget:(__bridge id)target];
		}
	}
	@catch (NSException* exception) {
		for (id<IMessageExceptionAdvice> advice in exceptionAdvices) {
			[advice exception:exception 
			 duringInvocation:methodName 
				   withTarget:(__bridge id)target];
		}
	}
	@finally {
	}	
}

Let me know if I am doing something wrong. 

Thanks
Pascal.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]