]> granicus.if.org Git - clang/commitdiff
use GetVLASize instead of accessing VLASizeMap directly, this gets an assert if
authorChris Lattner <sabre@nondot.org>
Fri, 14 Aug 2009 23:43:22 +0000 (23:43 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 14 Aug 2009 23:43:22 +0000 (23:43 +0000)
VLASize isn't populated for the type yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79057 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp

index 7ce1354ee07871a612c83ddc770a9084f4bdd6af..d806fb3b72d9afd510ab4ede411ce0bf332d2c35 100644 (file)
@@ -887,7 +887,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
   llvm::Value *Address = 0;
   if (const VariableArrayType *VAT = 
         getContext().getAsVariableArrayType(E->getType())) {
-    llvm::Value *VLASize = VLASizeMap[VAT];
+    llvm::Value *VLASize = GetVLASize(VAT);
     
     Idx = Builder.CreateMul(Idx, VLASize);