[cfe-commits] r99939 - in /cfe/trunk: lib/Parse/ParseCXXInlineMethods.cpp test/Parser/cxx-default-args.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Mar 30 15:40:37 PDT 2010


On Mar 31, 2010, at 1:32 AM, Douglas Gregor wrote:

> 
> On Mar 30, 2010, at 3:14 PM, Argiris Kirtzidis wrote:
> 
>> Author: akirtzidis
>> Date: Tue Mar 30 17:14:32 2010
>> New Revision: 99939
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=99939&view=rev
>> Log:
>> When "delayed parsing" C++ default arguments, if there is an error, there may be tokens left in the token stream
>> that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because
>> the CachedTokens that holds them will be deleted while the lexer is still using them.
>> 
>> Make sure that the tokens of default args are removed from the token stream.
>> Fixes PR6647.
> 
> Isn't there the potential for having this same problem in ParseLexedMethodDefs, where we've cached the tokens for the function body?

I've made a few tests and function bodies don't seem to have this problem, currently function bodies are fully parsed even in the case of errors.

Should I put an assert somewhere, for cached method bodies, to make sure ?

-Argiris



More information about the cfe-commits mailing list