[PATCH] D30963: Fix crash when an 'import a module' TypoCorrection has its CorrectionDecls replaced by visible decls.

Jorge Gorbe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 5 11:56:25 PDT 2017


jgorbe added inline comments.


================
Comment at: lib/Sema/SemaLookup.cpp:3792-3793
 static void checkCorrectionVisibility(Sema &SemaRef, TypoCorrection &TC) {
   if (TC.begin() == TC.end())
     return;
 
----------------
rsmith wrote:
> jgorbe wrote:
> > rsmith wrote:
> > > Do we need to clear the flag on this path too? (This might happen if the old correction required an import and after clearing we set this up as a keyword correction.)
> > If this might happen, then yes. I have updated the patch to clear the flag here as well but, on second thought, is this path necessary at all? It seems to me that 'no declarations' is a special case of 'all declarations are visible', which we check right after this.
> I agree, this check is redundant. Just go ahead and remove it :)
Done! :D

I don't have commit access yet, can you please commit it?


https://reviews.llvm.org/D30963





More information about the cfe-commits mailing list