[cfe-dev] Try-Throw-Catch handling in CFG

Jim Goodnow II Jim at TheGoodnows.net
Wed Nov 30 14:52:32 PST 2011


So, if I have a simple program like:

void foo()
{
   try { throw( 5 ); }
   catch( int x ) {}
   catch( ... ) {}
}

This generates a CFG that looks like: (Excuse the ASCII graphics .)

       throw
            |
            v
           try
  |                    |
  v                    v
catch(int)     catch(...)

where these are each blocks. How does the try block know the type of the 
throw argument? Should that be stored in the state on exit from the 
throw block or is there a better mechanism for passing that information?

Thanks!

  - jim




More information about the cfe-dev mailing list