don't assume iterators implicitly convert to pointers.
authorChris Lattner <sabre@nondot.org>
Mon, 1 Dec 2008 06:50:46 +0000 (06:50 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 1 Dec 2008 06:50:46 +0000 (06:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60336 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/STLExtras.h

index ae1a1abefda45cbb9a9c4bfe668627db1420016e..87f7a117251e5d713c890e64e21347de055b4f00 100644 (file)
@@ -254,7 +254,7 @@ template<class IteratorTy>
 static inline void array_pod_sort(IteratorTy Start, IteratorTy End) {
   // Don't dereference start iterator of empty sequence.
   if (Start == End) return;
-  qsort(Start, End-Start, sizeof(*Start),
+  qsort(&*Start, End-Start, sizeof(*Start),
         array_pod_sort_comparator<sizeof(*Start)>);
 }