[cfe-commits] r39664 - /cfe/cfe/trunk/CodeGen/CodeGenTypes.cpp

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:46:54 PDT 2007


Author: clattner
Date: Wed Jul 11 11:46:54 2007
New Revision: 39664

URL: http://llvm.org/viewvc/llvm-project?rev=39664&view=rev
Log:
assert, don't crash, on int[]

Modified:
    cfe/cfe/trunk/CodeGen/CodeGenTypes.cpp

Modified: cfe/cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=39664&r1=39663&r2=39664&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/cfe/trunk/CodeGen/CodeGenTypes.cpp Wed Jul 11 11:46:54 2007
@@ -84,7 +84,7 @@
            "FIXME: We only handle trivial array types so far!");
     
     llvm::APSInt Size(32);
-    if (A.getSize()->isIntegerConstantExpr(Size)) {
+    if (A.getSize() && A.getSize()->isIntegerConstantExpr(Size)) {
       const llvm::Type *EltTy = ConvertType(A.getElementType(), Loc);
       return llvm::ArrayType::get(EltTy, Size.getZExtValue());
     } else {





More information about the cfe-commits mailing list