Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

computeDependencies takes in a pointer to an OverlayFileSystem, checks if it is null, and creates a FileSystem object if it is. But then the code later unconditionally uses OverlayFS, which may be null. Use the pointer that is created/moved by the nullptr check.

We saw this come up in some downstream builds where we were seeing SIGILL.

computeDependencies takes in a pointer to an OverlayFileSystem, checks
if it is null, and creates a FileSystem object if it is. But then the
code later unconditionally uses OverlayFS, which may be null. Use the
pointer that is created/moved by the nullptr check.

We saw this come up in some downstream builds where we were seeing
SIGILL.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 6, 2026
@llvmbot
Copy link
Member

llvmbot commented Jan 6, 2026

@llvm/pr-subscribers-clang

Author: Aiden Grossman (boomanaiden154)

Changes

computeDependencies takes in a pointer to an OverlayFileSystem, checks if it is null, and creates a FileSystem object if it is. But then the code later unconditionally uses OverlayFS, which may be null. Use the pointer that is created/moved by the nullptr check.

We saw this come up in some downstream builds where we were seeing SIGILL.


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

1 Files Affected:

  • (modified) clang/lib/DependencyScanning/DependencyScanningWorker.cpp (+1-1)
diff --git a/clang/lib/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/DependencyScanning/DependencyScanningWorker.cpp
index 266660cdfab28..25c8a092d38c2 100644
--- a/clang/lib/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/DependencyScanning/DependencyScanningWorker.cpp
@@ -96,7 +96,7 @@ bool DependencyScanningWorker::computeDependencies(
     }
 
     auto DiagEngineWithDiagOpts =
-        DiagnosticsEngineWithDiagOpts(Cmd, OverlayFS, DiagConsumer);
+        DiagnosticsEngineWithDiagOpts(Cmd, FS, DiagConsumer);
     auto &Diags = *DiagEngineWithDiagOpts.DiagEngine;
 
     // Create an invocation that uses the underlying file system to ensure that

@boomanaiden154 boomanaiden154 merged commit 912a683 into llvm:main Jan 6, 2026
11 of 12 checks passed
@boomanaiden154 boomanaiden154 deleted the clangd-overlayfs-nullptr-1-5-26 branch January 6, 2026 02:42
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jan 6, 2026
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.

3 participants