[clang] 82b9216 - Fix UB introduced by be0aa7b6c72bdb162f1f3fe251e469927118963e.
Qiongsi Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 7 19:46:18 PST 2025
Author: Qiongsi Wu
Date: 2025-11-07T19:45:08-08:00
New Revision: 82b921628b97f1ca45b524439aea86018712b85f
URL: https://github.com/llvm/llvm-project/commit/82b921628b97f1ca45b524439aea86018712b85f
DIFF: https://github.com/llvm/llvm-project/commit/82b921628b97f1ca45b524439aea86018712b85f.diff
LOG: Fix UB introduced by be0aa7b6c72bdb162f1f3fe251e469927118963e.
Added:
Modified:
clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp
Removed:
################################################################################
diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp
index 33f564057ecc9..4178d1fd352c3 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp
@@ -714,12 +714,12 @@ bool CompilerInstanceWithContext::initialize(DiagnosticConsumer *DC) {
DiagConsumer = &DiagPrinterWithOS->DiagPrinter;
}
- DiagEngineWithCmdAndOpts = std::make_unique<DignosticsEngineWithDiagOpts>(
- CommandLine, OverlayFS, *DiagConsumer);
-
std::tie(OverlayFS, CommandLine) = initVFSForByNameScanning(
Worker.BaseFS, CommandLine, CWD, "ScanningByName");
+ DiagEngineWithCmdAndOpts = std::make_unique<DignosticsEngineWithDiagOpts>(
+ CommandLine, OverlayFS, *DiagConsumer);
+
std::tie(Driver, Compilation) = buildCompilation(
CommandLine, *DiagEngineWithCmdAndOpts->DiagEngine, OverlayFS, Alloc);
More information about the cfe-commits
mailing list