]> granicus.if.org Git - clang/commitdiff
We have to allow one to form an address for one past the end. WIP.
authorMike Stump <mrs@apple.com>
Mon, 14 Dec 2009 22:14:31 +0000 (22:14 +0000)
committerMike Stump <mrs@apple.com>
Mon, 14 Dec 2009 22:14:31 +0000 (22:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91347 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp

index 47d2ee96d85140de611478f3f30fac8fb80eb07e..b9334d0a84bba88ae7e54ed476161d21e33c28e6 100644 (file)
@@ -1078,7 +1078,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
               = getContext().getAsConstantArrayType(DRE->getType())) {
             llvm::APInt Size = CAT->getSize();
             llvm::BasicBlock *Cont = createBasicBlock("cont");
-            Builder.CreateCondBr(Builder.CreateICmpULT(Idx,
+            Builder.CreateCondBr(Builder.CreateICmpULE(Idx,
                                   llvm::ConstantInt::get(Idx->getType(), Size)),
                                  Cont, getAbortBB());
             EmitBlock(Cont);