[PATCH] D105533: [clang] Fix an infinite loop during typo-correction
David Goldman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 7 09:51:41 PDT 2021
dgoldman added inline comments.
================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:8340
}
+ // Bail out if we didn't make any correction progress on the checking
+ // TypoExpr TE, otherwise we risk running the loop forever.
----------------
dgoldman wrote:
> sammccall wrote:
> > Comment is good but maybe could mention the high-level effect of breaking out (treat as unambiguous)
> At this point we know the tree is so invalid that transforming no longer works, so our correction didn't really help. Is it even worth suggesting a correction (if we treat it as ambiguous we won't)?
Nevermind, misunderstood, left some comments on the bug there. What happens if the right correction actually was ambiguous though? Would we skip it here?
================
Comment at: clang/test/Sema/typo-correction-no-hang.c:4-14
+struct a {
+ int xxx;
+};
+
+int g_107;
+int g_108;
+int g_109;
----------------
Could you add another test case for the same thing but making the correction ambiguous, e.g. g_998 or similar?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105533/new/
https://reviews.llvm.org/D105533
More information about the cfe-commits
mailing list