[clang] [clang] Fix null buffer dereference in InitializeFileRemapping (PR #201289)

Macro Terra via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 6 07:53:04 PDT 2026


hongtaihu wrote:

> Thanks for the guidance. After reviewing CompilerInstanceTest.cpp and tracing all callers of addRemappedFile(StringRef, MemoryBuffer*) across clang/lib/, clang/tools/, and clang-tools-extra/, every call site passes a buffer constructed via getMemBuffer() or getMemBufferCopy() null is impossible by construction. The fuzzer was generating an invalid state that can't occur through any legitimate code path. I'll close this PR.

If you had time, maybe you could take a look at https://github.com/llvm/llvm-project/issues/201179? This one can be triggered directly on godbolt and I am not sure if it shares the same reason with this one.

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


More information about the cfe-commits mailing list