This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]