Skip to content

[clang-sycl-linker] Fix use of uninitialized memory in temp files #114488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

sarnex
Copy link
Member

@sarnex sarnex commented Oct 31, 2024

This fixes the current sanitizer CI failures. I manually confirmed the fix with a MemorySanitizer build.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
@sarnex sarnex marked this pull request as ready for review October 31, 2024 23:27
@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: Nick Sarnie (sarnex)

Changes

This fixes the current sanitizer CI failures. I manually confirmed the fix with a MemorySanitizer build.


Full diff: https://github.com/llvm/llvm-project/pull/114488.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..076458a275d986 100644
--- a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+++ b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
@@ -230,7 +230,7 @@ Expected<StringRef> linkDeviceInputFiles(ArrayRef<std::string> InputFiles,
   CmdArgs.push_back("--suppress-warnings");
   if (Error Err = executeCommands(*LLVMLinkPath, CmdArgs))
     return std::move(Err);
-  return *OutFileOrErr;
+  return Args.MakeArgString(*OutFileOrErr);
 }
 
 // This utility function is used to gather all SYCL device library files that

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.

Good catch, thanks.

@bader
Copy link
Contributor

bader commented Nov 1, 2024

PR title: "[Clang][SYCL] Fix use of uninitalized memory in temp files"

tag: [Clang][SYCL] -> [clang-sycl-linker]
typo: uninitalized -> uninitialized

@sarnex sarnex changed the title [Clang][SYCL] Fix use of uninitalized memory in temp files [clang-sycl-linker] Fix use of uninitialized memory in temp files Nov 1, 2024
@sarnex
Copy link
Member Author

sarnex commented Nov 1, 2024

PR title fixed, thanks.

@jhuber6 @bader This should be ready for merge. CI fails are not related. Can one of you merge please? I don't have write. Thx.

@jhuber6 jhuber6 merged commit 83ce977 into llvm:main Nov 1, 2024
10 of 12 checks passed
smallp-o-p pushed a commit to smallp-o-p/llvm-project that referenced this pull request Nov 3, 2024
…vm#114488)

This fixes the current sanitizer CI
[failures](https://lab.llvm.org/buildbot/#/builders/169/builds/4839/steps/13/logs/stdio).
I manually confirmed the fix with a MemorySanitizer build.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
…vm#114488)

This fixes the current sanitizer CI
[failures](https://lab.llvm.org/buildbot/#/builders/169/builds/4839/steps/13/logs/stdio).
I manually confirmed the fix with a MemorySanitizer build.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
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