summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-28 17:15:36 +0000
committerDan Gohman <gohman@apple.com>2010-07-28 17:15:36 +0000
commit1da02dfbe3b8cf260f61cd655859347062128cc9 (patch)
tree9b678f1fc6fb9201e520a24f0a6d9b0ab1c9561c
parent9cd20bf7928b55a40d85d3735944b2148a99959c (diff)
downloadbcm5719-llvm-1da02dfbe3b8cf260f61cd655859347062128cc9.tar.gz
bcm5719-llvm-1da02dfbe3b8cf260f61cd655859347062128cc9.zip
Fix this code to avoid decrementing an iterator past the beginning
of a std::vector. llvm-svn: 109597
-rw-r--r--llvm/lib/Target/PIC16/PIC16.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16.h b/llvm/lib/Target/PIC16/PIC16.h
index cee55f4f260..08bb3e6f055 100644
--- a/llvm/lib/Target/PIC16/PIC16.h
+++ b/llvm/lib/Target/PIC16/PIC16.h
@@ -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();
}
}
OpenPOWER on IntegriCloud