Shaheed R. Haque srhaque at
Sat May 17 03:38:29 CDT 2003

Hi Greg,

Not sure if this is off-base, but is it correct to assume that __wine_pop_frame 
is based on setjmp/longjmp? If not, ignore the rest of this note.

If it is, then one issue to think about is that all the user variables in the 
handler blocks which are also used in the try block must be declared volatile. 
For example,

    int x;
         x = ...
         y = x;

won't work right unless x is volatile (because the compile's flow analysis and 
register usage will get confused). Since the original code is unlikely to be so 
marked, you have a problem. In general, AFAICS, any solution implemented at the 
language level has this problem...without compiler support you are stuffed.

I am in the middle of solving a similar problem at work (i.e. forward porting 
and old C codebase using both exceptions, and a homebrew ORB which also has 
exceptions handled in a unified way). The ONLY solution I could come up with 
was indeed to use C++'s native exceptions, but wrapped in macros in such a way 
that the legacy code works without change. In fact, it works better than the 
legacy code because the legacy coders sometimes forgot to mark variables as 
volatile :-).

If this is any use to you, contact off-list (I am not subscribed), and I can 
assist with the conceptual version of the macros - I've long forgotten the MSVC 
exception details.

Thanks, Shaheed

More information about the wine-devel mailing list