From eb57a6bec5299781156f77b80bce0c497cfee9d5 Mon Sep 17 00:00:00 2001 From: olegsidorkin Date: Mon, 16 May 2022 22:21:52 +0300 Subject: [PATCH] fix: Fix crash with empty include filename in preprocessor output (#1075) --- src/ccache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ccache.cpp b/src/ccache.cpp index 5316d20e1..b0c27d064 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -539,6 +539,10 @@ process_preprocessed_file(Context& ctx, Hash& hash, const std::string& path) while (q < end && *q != '"') { q++; } + if (p == q) { + // Skip empty file name. + continue; + } // Look for preprocessor flags, after the "filename". bool system = false; const char* r = q + 1; -- 2.47.2