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 | 434ffe49a9595858f7ccc5ccf4eaadb22f958bce (patch) | |
tree | d5ba43c1001b5e5d5bb7eabe9728bd9e3a36cad8 /llvm/lib/CodeGen/AsmPrinter.cpp | |
parent | 5c0b4df483eadc32c4000aab9a00439e4cd84934 (diff) | |
download | bcm5719-llvm-434ffe49a9595858f7ccc5ccf4eaadb22f958bce.tar.gz bcm5719-llvm-434ffe49a9595858f7ccc5ccf4eaadb22f958bce.zip |
Don't emit a null terminator, nor anything after it, to the ctor/dtor list
llvm-svn: 24887
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 0539d463250..26a3d39db5e 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/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)); } } |