It's invalid to take the one-past-the-end address of a non-array

object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2008-06-20 00:49:21 +00:00
parent 09ef00f979
commit 65c6795af4

View 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