diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-28 17:15:36 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-28 17:15:36 +0000 |
commit | 6d3b9226708e85813c9d43ef32f87ac149ea1d70 (patch) | |
tree | 82a8cb59e0b0273d91f3cb4e0bd77139a89e60a4 /lib/Target/PIC16 | |
parent | 33591af872045194dc00321041affb92810183b4 (diff) |
Fix this code to avoid decrementing an iterator past the beginning
of a std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PIC16')
-rw-r--r-- | lib/Target/PIC16/PIC16.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Target/PIC16/PIC16.h b/lib/Target/PIC16/PIC16.h index cee55f4f26..08bb3e6f05 100644 --- a/lib/Target/PIC16/PIC16.h +++ b/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(); } } |