]> granicus.if.org Git - clang/commitdiff
fix a nasty bug Owen noticed in a gcc warning.
authorChris Lattner <sabre@nondot.org>
Fri, 20 Jul 2007 18:13:33 +0000 (18:13 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 20 Jul 2007 18:13:33 +0000 (18:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40110 91177308-0d34-0410-b5e6-96231b3b80d8

AST/ASTContext.cpp

index 0de2d5e4e657be9836297cda15f996f4e741053f..29057b491ff76e36cba524bcf245e9c3de2847b2 100644 (file)
@@ -160,18 +160,18 @@ ASTContext::getTypeInfo(QualType T, SourceLocation L) {
   case Type::TypeName: assert(0 && "Not a canonical type!");
   case Type::FunctionNoProto:
   case Type::FunctionProto:
-    assert(0 && "Incomplete types have no size!");
   default:
+    assert(0 && "Incomplete types have no size!");
   case Type::Array: {
     std::pair<uint64_t, unsigned> EltInfo = 
       getTypeInfo(cast<ArrayType>(T)->getElementType(), L);
     
     // Get the size of the array.
-    llvm::APSInt Size(32);
-    if (!cast<ArrayType>(T)->getSizeExpr()->isIntegerConstantExpr(Size, *this))
+    llvm::APSInt Sz(32);
+    if (!cast<ArrayType>(T)->getSizeExpr()->isIntegerConstantExpr(Sz, *this))
       assert(0 && "VLAs not implemented yet!");
     
-    Size = EltInfo.first*Size.getZExtValue();
+    Size = EltInfo.first*Sz.getZExtValue();
     Align = EltInfo.second;
     break;
   }