It turns out that we emitted completely wrong common EH frame since the early beginni...
authorAnton Korobeynikov <asl@math.spbu.ru>
Mon, 15 Feb 2010 22:36:41 +0000 (22:36 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Mon, 15 Feb 2010 22:36:41 +0000 (22:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96287 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfException.cpp

index e3f06a3347b90df11c7a39446ada8d7e5d5c52e4..35d9b3613bc7b2d900e6519f89ac6e584b3ce4fa 100644 (file)
@@ -147,13 +147,15 @@ void DwarfException::EmitCIE(const Function *PersonalityFn, unsigned Index) {
   Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), true));
   EOL("CIE Return Address Column");
 
-  EmitULEB128(AugmentationSize, "Augmentation Size");
-
-  // If there is a personality, we need to indicate the function's location.
-  if (PersonalityFn) {
-    EmitEncodingByte(PerEncoding, "Personality");
-    EmitReference(PersonalityFn, PerEncoding);
-    EOL("Personality");
+  if (Augmentation[0]) {
+    EmitULEB128(AugmentationSize, "Augmentation Size");
+
+    // If there is a personality, we need to indicate the function's location.
+    if (PersonalityFn) {
+      EmitEncodingByte(PerEncoding, "Personality");
+      EmitReference(PersonalityFn, PerEncoding);
+      EOL("Personality");
+    }
     if (UsesLSDA[Index])
       EmitEncodingByte(LSDAEncoding, "LSDA");
     if (FDEEncoding != dwarf::DW_EH_PE_absptr)