aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorLarisse Voufo <lvoufo@google.com>2015-02-15 08:47:30 +0000
committerLarisse Voufo <lvoufo@google.com>2015-02-15 08:47:30 +0000
commit1af89ed4267d7f31c8065a52a11900c51b2d2b88 (patch)
tree91b7f08cd8cd8b12713f99645278d634952db942 /llvm/lib/Bitcode
parent0ddfe0c7c5a69d9894c8625b46426fddc9230aae (diff)
downloadllvm-1af89ed4267d7f31c8065a52a11900c51b2d2b88.zip
llvm-1af89ed4267d7f31c8065a52a11900c51b2d2b88.tar.gz
llvm-1af89ed4267d7f31c8065a52a11900c51b2d2b88.tar.bz2
Don't crash on `struct ::, struct ::` (and the same for enums).
The first part of that line doesn't parse correctly and ParseClassSpecifier() for some reason skips to tok::comma to recover, and then ParseDeclarationSpecifiers() sees the next struct and calls ParseClassSpecifier() again with the same DeclSpec object. However, the first call already called ActOnCXXGlobalScopeSpecifier() on the DeclSpec's CXXScopeSpec, and sema gets confused when this gets called again. As a fix, let ParseClassSpecifier() (and ParseEnumSpecifier()) call ParseOptionalCXXScopeSpec() with a temporary CXXScopeSpec object, and only copy it into the DeclSpec if things work out. (This is also how all the other functions that set the DeclSpec's TypeSpecScope set it.) Found by SLi's bot. llvm-svn: 229293
Diffstat (limited to 'llvm/lib/Bitcode')
0 files changed, 0 insertions, 0 deletions