This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_setjmp/__builtin_longjmp Implementation
- From: John Love-Jensen <eljay at adobe dot com>
- To: 王 刚伟 <gwwang10 at hotmail dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Fri, 02 Feb 2007 07:05:56 -0600
- Subject: Re: __builtin_setjmp/__builtin_longjmp Implementation
Hi David,
My first suspicion is that your setjmp/longjmp is interleaved with C++
exception handling mechanism (regardless if the mechanism is sjlj or
something else).
Those two mechanisms do not play nice together.
Since you are programming in C++, I strongly recommend that you remove all
setjmp/longjmp code, and solely use the C++ exception mechanism.
If you cannot do that, I strongly recommend that you only use C code inside
the context of the setjmp body, which should insure that you never leak an
exception out of the context of the setjmp body, nor that you interleave
setjmp/longjmp and C++ exceptions.
Otherwise, since it interleaving them won't work in software, you'll have to
fix the problem in marketing, and have them sell random crashes as a
feature.
HTH,
--Eljay