[fpc-pascal] Unhandled exception from library crashes host exe

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jun 28 11:45:19 CEST 2012


kyan wrote on Thu, 28 Jun 2012:

> It seem that the way to go -I don't have much knowledge on SEH so I'd
> rather not mess with such low level system code- is to try to turn my
> API to safecall and install a SafeCallErrorProc handler that will try
> to recreate and raise the safecall exception from the callee module to
> the caller one, which will eventually bubble up to the exe and the
> main message loop. From what I've seen the safecall exception is not
> based on any OS functionality but it is implemented by "compiler
> magic" therefore I expect it to work (at least for application-defined
> exceptions) in all OSes.

The safecall calling convention is only supported on a few platforms.  
Originally it was only supported on Windows. Nowadays it's also  
supported on a few extra platforms because it was required for XPCOM  
(someone wanted to use XPCOM on certain platforms, and only added  
suppport for safecall on those particular platforms), but it's  
definitely not yet supported everywhere. I'm also not aware of anyone  
planning on adding support for safecall on other platforms.


Jonas



More information about the fpc-pascal mailing list