diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-12-28 23:24:02 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-12-28 23:24:02 +0000 |
commit | c29c4835dfc2a3be6c156ce6f54995221ac480a8 (patch) | |
tree | 387ea4b00079cb13f9bf791d04b06d5efab222f5 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 380443a2ac10906010e3d622b92395bdf8dbc82b (diff) | |
download | llvm-c29c4835dfc2a3be6c156ce6f54995221ac480a8.zip llvm-c29c4835dfc2a3be6c156ce6f54995221ac480a8.tar.gz llvm-c29c4835dfc2a3be6c156ce6f54995221ac480a8.tar.bz2 |
Don't crash on surprising tokens in default parameter template lists.
Fixes this snippet from SLi's afl fuzzer output:
class {
i (x = <, enum
This parsed i as a function, x as a paramter, and the stuff after < as a
template list. This then called TryConsumeDeclarationSpecifier() which
called TryAnnotateCXXScopeToken() without checking the preconditions of
this function. Check them before calling, like all other callers of
TryAnnotateCXXScopeToken() do.
A more readable reproducer that causes the same crash is
class {
void i(int x = MyTemplateClass<int, union int>::foo());
};
The reduced version used an eof token as surprising token, but kw_int works
just as well to repro and is easier to insert into a test file.
llvm-svn: 224906
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions