From: Artem Belevich Date: Wed, 18 Nov 2015 00:37:41 +0000 (+0000) Subject: Fix for use-after-free which caused test failure in cuda-detect.cu. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51ff8d7aa82cee89c4770832084ef5052692090a;p=clang 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 --- 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); } };