diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-02-23 23:06:04 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-02-23 23:06:04 +0000 |
commit | 9e060ca641a1f845cecb3371b3a3018d306a5198 (patch) | |
tree | 89ef2ce38500a10ee7ffbf88b0419f6e48c219c4 /lib/Sema/SemaChecking.cpp | |
parent | 277a6e752512cff286190d35cb353ce717e86b18 (diff) |
Fix bogus -Warray-bounds warning involving 'array[true]' reported in PR 9296.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index edee8af72b..5c2356f54d 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -3123,7 +3123,7 @@ void Sema::CheckArrayAccess(const clang::ArraySubscriptExpr *E) { if (!IndexExpr->isIntegerConstantExpr(index, Context)) return; - if (!index.isNegative()) { + if (index.isUnsigned() || !index.isNegative()) { llvm::APInt size = ArrayTy->getSize(); if (!size.isStrictlyPositive()) return; |