Doh. Must check if GV is constant first.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 28 Oct 2006 05:56:06 +0000 (05:56 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 28 Oct 2006 05:56:06 +0000 (05:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31252 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86AsmPrinter.cpp

index 0a4106c95387bba04ec2afb6fe07768fb9bd75d3..38dbe57aed0fa45f4f502600c1c7ef082d106dd2 100644 (file)
@@ -205,9 +205,9 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
         O << "\t.globl " << name << "\n";
         // FALL THROUGH
       case GlobalValue::InternalLinkage: {
-        if (TAI->getCStringSection()) {
+        if (I->isConstant()) {
           const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
-          if (CVA && CVA->isCString()) {
+          if (TAI->getCStringSection() && CVA && CVA->isCString()) {
             SwitchToDataSection(TAI->getCStringSection(), I);
             break;
           }