[llvm-commits] [llvm] r109597 - /llvm/trunk/lib/Target/PIC16/PIC16.h
Dan Gohman
gohman at apple.com
Wed Jul 28 10:15:36 PDT 2010
Author: djg
Date: Wed Jul 28 12:15:36 2010
New Revision: 109597
URL: http://llvm.org/viewvc/llvm-project?rev=109597&view=rev
Log:
Fix this code to avoid decrementing an iterator past the beginning
of a std::vector.
Modified:
llvm/trunk/lib/Target/PIC16/PIC16.h
Modified: llvm/trunk/lib/Target/PIC16/PIC16.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.h?rev=109597&r1=109596&r2=109597&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16.h (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16.h Wed Jul 28 12:15:36 2010
@@ -58,13 +58,10 @@
ESNames() {}
public:
~ESNames() {
- std::vector<char*>::iterator it = stk.end();
- it--;
- while(stk.end() != stk.begin())
+ while (!stk.empty())
{
- char* p = *it;
+ char* p = stk.back();
delete [] p;
- it--;
stk.pop_back();
}
}
More information about the llvm-commits
mailing list