MC/Mach-O: Fix regression introduced in r126127, this assignment shouldn't have
authorDaniel Dunbar <daniel@zuster.org>
Thu, 17 Mar 2011 16:25:24 +0000 (16:25 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 17 Mar 2011 16:25:24 +0000 (16:25 +0000)
been removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127812 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/DarwinAsmParser.cpp
test/MC/MachO/section-attributes.s [new file with mode: 0644]

index e1f49c2609dad972e9c0e70e32b54c8e05b7d2b4..f01f866846d3eb3e5ca701d1c9f8a7f2529932f3 100644 (file)
@@ -434,7 +434,8 @@ bool DarwinAsmParser::ParseDirectiveSection(StringRef, SMLoc) {
 
 
   StringRef Segment, Section;
-  unsigned TAA, StubSize;
+  unsigned StubSize;
+  unsigned TAA = 0;
   std::string ErrorStr =
     MCSectionMachO::ParseSectionSpecifier(SectionSpec, Segment, Section,
                                           TAA, StubSize);
diff --git a/test/MC/MachO/section-attributes.s b/test/MC/MachO/section-attributes.s
new file mode 100644 (file)
index 0000000..b21ef38
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o %t
+// RUN: macho-dump %t | FileCheck %s
+
+// CHECK: # Section 1
+// CHECK: ('flags', 0x0)
+.section __TEXT,__objc_opt_ro
+.long 0