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

Aiden Grossman via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 5 17:57:49 PST 2026


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

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.

>From ac07a56975decf32c1d5ce2513a50f7bfd05cc59 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 6 Jan 2026 01:54:53 +0000
Subject: [PATCH] [DependencyScanning] Do not use maybe null OverlayFS

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.
---
 clang/lib/DependencyScanning/DependencyScanningWorker.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



More information about the cfe-commits mailing list