================ @@ -126,7 +126,8 @@ class CachedFileSystemEntry { private: void clearStatName() { - if (MaybeStat) + + if (MaybeStat && MaybeStat->getName().empty()) //If MaybeStat is an error, calling copyWithNewName() can cause undefined behavior ---------------- ayushpareek2003 wrote:
I initially thought it would be good to explicitly set the name to an empty string to ensure consistency across versions. However, since the condition is only updating the name, this extra check is unnecessary https://github.com/llvm/llvm-project/pull/130667 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits