diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/System/Win32/Path.inc | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc index 2dbf13e8ccb..7e2275105a3 100644 --- a/llvm/lib/System/Win32/Path.inc +++ b/llvm/lib/System/Win32/Path.inc @@ -68,7 +68,12 @@ Path::operator=(StringRef that) {  struct ScopedNullTerminator {    std::string &str;    ScopedNullTerminator(std::string &s) : str(s) { str.push_back(0); } -  ~ScopedNullTerminator() { str.pop_back(); } +  ~ScopedNullTerminator() { +    // str.pop_back(); But wait, C++03 doesn't have this... +    assert(!str.empty() && str[str.size() - 1] == 0 +      && "Null char not present!"); +    str.resize(str.size() - 1); +  }  };  bool  | 

