HomePhabricator

[Sema][Typo Correction] Fix potential infite loop on ambiguity checks

Description

[Sema][Typo Correction] Fix potential infite loop on ambiguity checks

Summary:
This fixes a bug introduced in D62648, where Clang could infinite loop
if it became stuck on a single TypoCorrection when it was supposed to
be testing ambiguous corrections. Although not a common case, it could
happen if there are multiple possible corrections with the same edit
distance.

The fix is simply to wipe the TypoExpr from the TransformCache so that
the call to TransformTypoExpr doesn't use the CachedEntry.

Reviewers: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67515

Details

Committed
dgoldmanSep 13 2019, 7:43 AM
Differential Revision
D67515: [Sema][Typo Correction] Fix potential infite loop on ambiguity checks
Parents
rL371858: gn build: pacify "gn format" after 371102
Branches
Unknown
Tags
Unknown