Fix for use-after-free which caused test failure in cuda-detect.cu.

Return std::string itself instead StringRef to a temporary std::string.

llvm-svn: 253410
This commit is contained in:
Artem Belevich 2015-11-18 00:37:41 +00:00
parent 6196aa06c9
commit 6e50375286
1 changed files with 1 additions and 1 deletions

View 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);
}
};