[LLVMdev] RFA: Problem with Exceptions
Dale Johannesen
dalej at apple.com
Thu Aug 30 15:49:43 PDT 2007
On Aug 30, 2007, at 3:31 PM, Bill Wendling wrote:
> Hi all,
>
> I'm compiling this trivial program on Darwin:
>
> int main(int argc, char **argv) {
> try {
> throw argc;
> } catch(int i) {
> return i;
> }
>
> return 0;
> }
>
> However, it segfaults when I run it. I've attached the .s files
> generated by LLVM and GCC, but it looks as if LLVM isn't generating a
> gxx_personality_v0 section (like it does for Unwind_Resume, et al). Is
> this what's causing the failure? Does anyone know how to get it to
> generate this section?
The most obvious thing different is that gcc expects the return value
of the
throw (EDX) to be 1, while llvm expects it to be 2. Try changing the
cmp to 2
at line 46 to cmp against 1 instead and see if that works.
> Thanks!
> -bw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.gcc.s
Type: application/octet-stream
Size: 4259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070830/be66d92a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.llvm.s
Type: application/octet-stream
Size: 4162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070830/be66d92a/attachment-0001.obj>
-------------- next part --------------
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list