forked from OSchip/llvm-project
Don't emit a null terminator, nor anything after it, to the ctor/dtor list
llvm-svn: 24887
This commit is contained in:
parent
5c0b4df483
commit
434ffe49a9
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue