Skip to content

Commit

Permalink
Fix for use-after-free which caused test failure in cuda-detect.cu.
Browse files Browse the repository at this point in the history
Return std::string itself instead StringRef to a temporary std::string.

llvm-svn: 253410
  • Loading branch information
Artem-B committed Nov 18, 2015
1 parent 6196aa0 commit 6e50375
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class LLVM_LIBRARY_VISIBILITY Generic_GCC : public ToolChain {
/// \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);
}
};
Expand Down

0 comments on commit 6e50375

Please sign in to comment.