summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2009-08-29 01:12:46 +0000
committerEric Christopher <echristo@apple.com>2009-08-29 01:12:46 +0000
commit743dc0ef4080fb4328fcb7a6dcfddc4813b7fbf7 (patch)
treefccd1a8a1d8d5243d9afe196f1c3dadfea207e4d /llvm/lib/CodeGen
parent938b10079a8196c469ec995e37ed2853b979c56c (diff)
downloadbcm5719-llvm-743dc0ef4080fb4328fcb7a6dcfddc4813b7fbf7.tar.gz
bcm5719-llvm-743dc0ef4080fb4328fcb7a6dcfddc4813b7fbf7.zip
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: 80414
Diffstat (limited to 'llvm/lib/CodeGen')
-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 c62403efa0b..a8d8bfd7590 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud