diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-21 01:17:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-21 01:17:37 +0000 |
commit | 8de324b59ce81cfb4202c706c96a3140f52e00c0 (patch) | |
tree | 2de829bc6e6732cb085b201f54cdcb35e0ed99c0 /lib/CodeGen/AsmPrinter.cpp | |
parent | bbc8ddbea30ea807ef6deeaa2b7965e38ac3c28a (diff) |
Don't emit a null terminator, nor anything after it, to the ctor/dtor list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 0539d46325..26a3d39db5 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -146,7 +146,10 @@ void AsmPrinter::EmitXXStructorList(Constant *List) { for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) if (ConstantStruct *CS = dyn_cast<ConstantStruct>(InitList->getOperand(i))){ if (CS->getNumOperands() != 2) return; // Not array of 2-element structs. - // Emit the function pointer. + + if (CS->getOperand(1)->isNullValue()) + return; // Found a null terminator, exit printing. + // Emit the function pointer. EmitGlobalConstant(CS->getOperand(1)); } } |