================ @@ -51,8 +51,14 @@ llvm::Expected<PathSeq> enumerateFiles(FileManager &FM, StringRef Directory) { if (EC) return errorCodeToError(EC); + // Ensure the iterator is valid before dereferencing. + if (i == ie) ---------------- cyndyishida wrote:
Why does this make a difference? The same check happens at each iteration of the loop on line 50. There's no mutations on `i` or `ie` between there and this check. https://github.com/llvm/llvm-project/pull/97900 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits