logo       

Re: C++ exceptions: msg#00023

gnu.cegcc.devel

Subject: Re: C++ exceptions

Kevin O'Connor wrote:

>> DWORD* sp = (DWORD*)ContextRecord->Sp;
>> *--sp = ContextRecord->Pc;
> [...]
>
> Sp is the stack of the main code, and the exception handler writes to
> that stack space. Are we guarenteed that if we longjmp back to the
> main code that it wont corrupt anything? (In general, I wouldn't
> think it would be a problem because the stack grows down - but do we
> have a guarantee that gcc always decrements sp before using it?)
>

I think we do. Even 'alloca's are only "released" at function exit,
isn't it?

Cheers,
Pedro Alves


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise