r253410 - Fix for use-after-free which caused test failure in cuda-detect.cu.
Artem Belevich via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 17 16:37:41 PST 2015
Author: tra
Date: Tue Nov 17 18:37:41 2015
New Revision: 253410
URL: http://llvm.org/viewvc/llvm-project?rev=253410&view=rev
Log:
Fix for use-after-free which caused test failure in cuda-detect.cu.
Return std::string itself instead StringRef to a temporary std::string.
Modified:
cfe/trunk/lib/Driver/ToolChains.h
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=253410&r1=253409&r2=253410&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Tue Nov 17 18:37:41 2015
@@ -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);
}
};
More information about the cfe-commits
mailing list