[clang] [DependencyScanning] Do not use maybe null OverlayFS (PR #174515)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 5 17:58:21 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

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
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

``````````

</details>


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


More information about the cfe-commits mailing list