It's invalid to take the one-past-the-end address of a non-array
authorDan Gohman <gohman@apple.com>
Fri, 20 Jun 2008 00:49:21 +0000 (00:49 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 20 Jun 2008 00:49:21 +0000 (00:49 +0000)
object.

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

include/llvm/Analysis/ValueTracking.h

index 73f87713cb2ef28208b8c9173a00fd393d5ce00d..e2f76340020cf46e8e38ce7577caaf08faa8e178 100644 (file)
@@ -67,7 +67,8 @@ namespace llvm {
   /// only.
   inline Value *FindInsertedValue(Value *V, const unsigned Idx,
                                  Instruction *InsertBefore = 0) {
-    return FindInsertedValue(V, &Idx, &Idx + 1, InsertBefore);
+    const unsigned Idxs[1] = { Idx };
+    return FindInsertedValue(V, &Idxs[0], &Idxs[1], InsertBefore);
   }
 } // end namespace llvm