aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2009-09-13 19:12:07 +0000
committerTanya Lattner <tonic@nondot.org>2009-09-13 19:12:07 +0000
commita6349914199e0414c07379dc59c64549f4a04194 (patch)
treea258aed7e52f9fc9c12deaa48cdcbb4ece446f24
parentfea943141ab09f54bd5c95e1a0c73c6779f2f071 (diff)
downloadllvm-a6349914199e0414c07379dc59c64549f4a04194.zip
llvm-a6349914199e0414c07379dc59c64549f4a04194.tar.gz
llvm-a6349914199e0414c07379dc59c64549f4a04194.tar.bz2
Merge 80414 from mainline.
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. llvm-svn: 81701
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 8153689..5b797ac 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -203,13 +203,19 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) {
// If there is a personality and landing pads then point to the language
// specific data area in the exception table.
if (EHFrameInfo.PersonalityIndex) {
- 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);