Skip to content

Conversation

@asudarsa
Copy link
Contributor

No description provided.

Signed-off-by: Arvind Sudarsanam <[email protected]>
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 31, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 31, 2024

@llvm/pr-subscribers-clang

Author: Arvind Sudarsanam (asudarsa)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/114434.diff

1 Files Affected:

  • (modified) clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp (+1-1)
diff --git a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
index 0639b95c76e218..fa37cbeb56316c 100644
--- a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+++ b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
@@ -237,7 +237,7 @@ Expected<StringRef> linkDeviceInputFiles(ArrayRef<std::string> InputFiles,
 // will be linked with input device files.
 // The list of files and its location are passed from driver.
 Expected<SmallVector<std::string>> getSYCLDeviceLibs(const ArgList &Args) {
-  SmallVector<std::string> DeviceLibFiles;
+  SmallVector<std::string> DeviceLibFiles{};
   StringRef LibraryPath;
   if (Arg *A = Args.getLastArg(OPT_library_path_EQ))
     LibraryPath = A->getValue();

@JOE1994
Copy link
Member

JOE1994 commented Oct 31, 2024

Since SmallVector<std::string> DeviceLibFiles; is default initialized to an empty vector,
this change seems unnecessary.

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A default constructed vector should just be empty, I don't think it would cause the issue the sanitizer is seeing.

@asudarsa
Copy link
Contributor Author

asudarsa commented Nov 1, 2024

This is not the correct fix. Closing it.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants