diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-05-29 20:17:55 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-05-29 20:17:55 +0000 |
commit | 587cbdfd95f4b0aaccc14b31f5debe85d5daf7ed (patch) | |
tree | 6defedc63ee77093df7492cc4ee30d7943e8872d /lib/AST/ASTContext.cpp | |
parent | bdad6b69f1214fb20116795f8e8cbf881e3017c6 (diff) |
Add an assertion so that we don't accidentally build constant arrays of
VLAs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index b230edb93d..00eaa361a3 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1063,6 +1063,9 @@ QualType ASTContext::getConstantArrayType(QualType EltTy, const llvm::APInt &ArySizeIn, ArrayType::ArraySizeModifier ASM, unsigned EltTypeQuals) { + assert((EltTy->isDependentType() || EltTy->isConstantSizeType()) && + "Constant array of VLAs is illegal!"); + // Convert the array size into a canonical width matching the pointer size for // the target. llvm::APInt ArySize(ArySizeIn); |