Fix a bug I introduced in constant array and constant vector handling.

llvm-svn: 47816
This commit is contained in:
Chris Lattner 2008-03-02 05:46:57 +00:00
parent 7295bc15a0
commit 9140fba6ad
1 changed files with 2 additions and 2 deletions

View File

@ -981,7 +981,7 @@ void CWriter::printConstant(Constant *CPV) {
}
case Type::ArrayTyID:
if (ConstantArray *CA = cast<ConstantArray>(CPV)) {
if (ConstantArray *CA = dyn_cast<ConstantArray>(CPV)) {
printConstantArray(CA);
} else {
assert(isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV));
@ -1005,7 +1005,7 @@ void CWriter::printConstant(Constant *CPV) {
Out << "(";
printType(Out, CPV->getType());
Out << ")";
if (ConstantVector *CV = cast<ConstantVector>(CPV)) {
if (ConstantVector *CV = dyn_cast<ConstantVector>(CPV)) {
printConstantVector(CV);
} else {
assert(isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV));