From: Eric Christopher Date: Sat, 29 Aug 2009 01:12:46 +0000 (+0000) Subject: Make the augmentation size and next set of bytes agree on size, X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6fefcebc4f92b944664b7b26042bc21e57aefe43;p=oota-llvm.git Make the augmentation size and next set of bytes agree on size, and make the reference pointer size as it should be. Fixes an abort on a testcase derived from libunwind's personality test in 64-bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80414 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index c62403efa0b..a8d8bfd7590 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -204,13 +204,19 @@ void DwarfException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) { // If there is a personality and landing pads then point to the language // specific data area in the exception table. if (MMI->getPersonalities()[0] != NULL) { - Asm->EmitULEB128Bytes(4); + bool is4Byte = TD->getPointerSize() == sizeof(int32_t); + + Asm->EmitULEB128Bytes(is4Byte ? 4 : 8); Asm->EOL("Augmentation size"); if (EHFrameInfo.hasLandingPads) - EmitReference("exception", EHFrameInfo.Number, true, true); - else - Asm->EmitInt32((int)0); + EmitReference("exception", EHFrameInfo.Number, true, false); + else { + if (is4Byte) + Asm->EmitInt32((int)0); + else + Asm->EmitInt64((int)0); + } Asm->EOL("Language Specific Data Area"); } else { Asm->EmitULEB128Bytes(0);