1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Fix this code to avoid decrementing an iterator past the beginning

of a std::vector.

llvm-svn: 109597
This commit is contained in:
Dan Gohman 2010-07-28 17:15:36 +00:00
parent 5295c21189
commit a4186ab5f0

View File

@ -58,13 +58,10 @@ namespace PIC16CC {
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();
}
}