[clang] [clang][modules] Fix UAF in `InProcessModuleCache` (PR #196117)
via cfe-commits
cfe-commits at lists.llvm.org
Wed May 6 09:53:01 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- clang/unittests/DependencyScanning/InProcessModuleCacheTest.cpp clang/include/clang/DependencyScanning/InProcessModuleCache.h clang/lib/DependencyScanning/InProcessModuleCache.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/unittests/DependencyScanning/InProcessModuleCacheTest.cpp b/clang/unittests/DependencyScanning/InProcessModuleCacheTest.cpp
index 0c6435bce..e239ae1e6 100644
--- a/clang/unittests/DependencyScanning/InProcessModuleCacheTest.cpp
+++ b/clang/unittests/DependencyScanning/InProcessModuleCacheTest.cpp
@@ -33,10 +33,9 @@ TEST(InProcessModuleCache, ReadWriteInvalidation) {
ASSERT_EQ(ModCache->write(Path, *NewBuf, Size, ModTime), std::error_code{});
// Writing a new buffer should not invalidate the previously-read buffer.
- EXPECT_EQ(Buf->getBuffer(),"original\n");
+ EXPECT_EQ(Buf->getBuffer(), "original\n");
}
-
TEST(InProcessModuleCache, ReadReadInvalidation) {
ModuleCacheEntries Entries;
std::shared_ptr<ModuleCache> ModCache = makeInProcessModuleCache(Entries);
``````````
</details>
https://github.com/llvm/llvm-project/pull/196117
More information about the cfe-commits
mailing list