From 51ff8d7aa82cee89c4770832084ef5052692090a Mon Sep 17 00:00:00 2001 From: Artem Belevich Date: Wed, 18 Nov 2015 00:37:41 +0000 Subject: [PATCH] Fix for use-after-free which caused test failure in cuda-detect.cu. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index b18739ce39..2b655f62bd 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -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); } }; -- 2.40.0