Fix accidental use of the exotic "std::string::back()" method. Turns out it's
authorLang Hames <lhames@gmail.com>
Thu, 9 Jan 2014 05:29:59 +0000 (05:29 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 9 Jan 2014 05:29:59 +0000 (05:29 +0000)
new in C++11.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198853 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lli/lli.cpp

index 5694715d128921468844d9a0cb81e2fa4ed9024b..0227261f4859d236d1339c0aae50bc2a00882dfd 100644 (file)
@@ -256,7 +256,8 @@ class LLIObjectCache : public ObjectCache {
 public:
   LLIObjectCache(const std::string& CacheDir) : CacheDir(CacheDir) {
     // Add trailing '/' to cache dir if necessary.
-    if (!this->CacheDir.empty() && this->CacheDir.back() != '/')
+    if (!this->CacheDir.empty() &&
+        this->CacheDir[this->CacheDir.size() - 1] != '/')
       this->CacheDir += '/'; 
   }
   virtual ~LLIObjectCache() {}