[LLVMdev] llvm-gcc4 and setjmp
Duncan Sands
baldrick at free.fr
Mon Aug 27 23:51:23 PDT 2007
> > Unfortunately, no. You can call setjmp/longjmp on the same jump buffer
> > multiple times. So, in general it's not possible to determine, where
> > jump destination is. The problem is much worse in case, when jump buffer
> > escapes from the function, where it was initialized (like in your case -
> > longjmp is called in the g() routine).
>
> LowerSetJmp should handle this by turning the call to g() into an invoke. If
> g() calls longjmp(), it will do an unwind.
>
> Are you saying that the LowerSetJmp pass doesn't work? Or that the whole
> idea of lowering setjmp/longjmp to invoke/unwind doesn't work?
If setjmp/longjmp are turned into invoke + unwind, how does this interact
with exception handling codegen (-enable-eh)? Won't eh codegen break this
trick?
Ciao,
Duncan.
More information about the llvm-dev
mailing list