fix a critical bug in smallvector, where it would destroy elements that are
authorChris Lattner <sabre@nondot.org>
Tue, 13 Feb 2007 07:25:36 +0000 (07:25 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 13 Feb 2007 07:25:36 +0000 (07:25 +0000)
not in its range (!).

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

include/llvm/ADT/SmallVector.h

index befed925101706d6e3958d189ac2706eb21a088a..b5ee6c454b3088e0b6e04b07963dfbad15bef357 100644 (file)
@@ -275,8 +275,8 @@ private:
   
   void destroy_range(T *S, T *E) {
     while (S != E) {
-      E->~T();
       --E;
+      E->~T();
     }
   }
 };