]> granicus.if.org Git - clang/commitdiff
Fix for use-after-free which caused test failure in cuda-detect.cu.
authorArtem Belevich <tra@google.com>
Wed, 18 Nov 2015 00:37:41 +0000 (00:37 +0000)
committerArtem Belevich <tra@google.com>
Wed, 18 Nov 2015 00:37:41 +0000 (00:37 +0000)
Return std::string itself instead StringRef to a temporary std::string.

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

lib/Driver/ToolChains.h

index b18739ce3931442860192bff8615695b78778c88..2b655f62bdd160400f7db5db63bc81dbbe47e870 100644 (file)
@@ -186,7 +186,7 @@ protected:
     /// \brief Get the detected Cuda device library path.
     StringRef getLibDevicePath() const { return CudaLibDevicePath; }
     /// \brief Get libdevice file for given architecture
-    StringRef getLibDeviceFile(StringRef Gpu) const {
+    std::string getLibDeviceFile(StringRef Gpu) const {
       return CudaLibDeviceMap.lookup(Gpu);
     }
   };