summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-12-29 06:56:50 +0000
committerNico Weber <nicolasweber@gmx.de>2014-12-29 06:56:50 +0000
commit4b4be84a2f747bc65ccfe53281ae0aa19259744c (patch)
treea9a3572b66ef241adff7aa31bc333022d40a4c6e /clang/lib/Sema
parent939111ac518530f79ffd430bbba4b846e8759518 (diff)
downloadbcm5719-llvm-4b4be84a2f747bc65ccfe53281ae0aa19259744c.tar.gz
bcm5719-llvm-4b4be84a2f747bc65ccfe53281ae0aa19259744c.zip
Don't crash on malformed attributes in an incorrect location.
r168626 added nicer diagnostics for attributes in the wrong places, such as after the `final` on a class. To do this, it added code that did high-level pattern matching for e.g. 'final' 'alignas' '(' and then skipped until the closing ')'. If it saw that, it then went down the regular class parsing path and then called MaybeParseCXX11Attributes() to parse the attribute after the 'final' using real attribute parsing code. On invalid attributes, the real attribute parsing code could eat more tokens than the pattern matching code and for example skip past the '{' starting the class, which would then lead to an assert. To prevent this, check for a good state after calling MaybeParseCXX11Attributes() (which morphed into CheckMisplacedCXX11Attribute() in r175575) and bail out if things look bleak. Found by SLi's afl bot. llvm-svn: 224915
Diffstat (limited to 'clang/lib/Sema')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud