Fix a bug I introduced in constant array and constant vector handling.
authorChris Lattner <sabre@nondot.org>
Sun, 2 Mar 2008 05:46:57 +0000 (05:46 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Mar 2008 05:46:57 +0000 (05:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47816 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp

index c13cdf5fda0778b6e45a9067d51b19a7ef19d240..7fcc3dd51db36a930d0810e03e3ec98363388517 100644 (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));