[cfe-commits] r130775 - in /cfe/trunk: lib/Parse/ParseExprCXX.cpp test/SemaTemplate/rdar9173693.cpp
Douglas Gregor
dgregor at apple.com
Tue May 3 13:25:22 PDT 2011
On May 3, 2011, at 11:45 AM, Argyrios Kyrtzidis wrote:
> Author: akirtzidis
> Date: Tue May 3 13:45:38 2011
> New Revision: 130775
>
> URL: http://llvm.org/viewvc/llvm-project?rev=130775&view=rev
> Log:
> Fix a double free when parsing malformed code. Fixes rdar://9173693.
>
> Added:
> cfe/trunk/test/SemaTemplate/rdar9173693.cpp
> Modified:
> cfe/trunk/lib/Parse/ParseExprCXX.cpp
>
> Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=130775&r1=130774&r2=130775&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Tue May 3 13:45:38 2011
> @@ -280,8 +280,11 @@
> : TemplateId->TemplateNameLoc;
> SS.SetInvalid(SourceRange(StartLoc, CCLoc));
> }
> -
> - TemplateId->Destroy();
> +
> + // If we are caching tokens we will process the TemplateId again,
> + // otherwise destroy it.
> + if (!PP.isBacktrackEnabled())
> + TemplateId->Destroy();
> continue;
> }
Ouch! Thanks for tracking this down.
- Doug
More information about the cfe-commits
mailing list