diff options
-rw-r--r-- | clang-tools-extra/modularize/PreprocessorTracker.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang-tools-extra/modularize/PreprocessorTracker.cpp b/clang-tools-extra/modularize/PreprocessorTracker.cpp index 2a41921cb46..894f3c0f771 100644 --- a/clang-tools-extra/modularize/PreprocessorTracker.cpp +++ b/clang-tools-extra/modularize/PreprocessorTracker.cpp @@ -980,9 +980,12 @@ public: if (HeaderPath.startswith("<")) return; HeaderHandle H = findHeaderHandle(HeaderPath); + HeaderHandle TH; if (isHeaderHandleInStack(H)) { - while ((H != getCurrentHeaderHandle()) && (HeaderStack.size() != 0)) + do { + TH = getCurrentHeaderHandle(); popHeaderHandle(); + } while ((TH != H) && (HeaderStack.size() != 0)); } InNestedHeader = false; } |