llvm-project/clang/lib/Lex
Argyrios Kyrtzidis 8b7252a8b3 Fix a nasty bug where inside StringLiteralParser:
1. We would assume that the length of the string literal token was at least 2
2. We would allocate a buffer with size length-2

And when the stars aligned (one of which would be an invalid source location due to stale PCH)
The length would be 0 and we would try to allocate a 4GB buffer.

Add checks for this corner case and a bunch of asserts.
(We really really should have had an assert for 1.).

Note that there's no test case since I couldn't get one (it was major PITA to reproduce),
maybe later.

llvm-svn: 131492
2011-05-17 22:09:56 +00:00
..
CMakeLists.txt Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter. 2011-02-11 23:46:38 +00:00
HeaderMap.cpp To be able to replay compilations we need to accurately remodel how 2011-04-26 21:50:03 +00:00
HeaderSearch.cpp Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(), 2011-05-04 00:14:37 +00:00
Lexer.cpp Don't strlen() every file before parsing it. 2011-05-10 17:11:21 +00:00
LiteralSupport.cpp Fix a nasty bug where inside StringLiteralParser: 2011-05-17 22:09:56 +00:00
MacroArgs.cpp Silence more -Wnon-pod-memset given its current implementation. I may be 2011-04-28 08:19:45 +00:00
MacroArgs.h The PreExpArgTokens array is indexed with an argument #, 2009-12-28 06:17:16 +00:00
MacroInfo.cpp Fix diagnostic pragmas. 2010-12-15 18:44:22 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
PPCaching.cpp Remove the check for repeated tok::eofs, we are not supposed to go past eof so this code is 2010-07-12 21:41:41 +00:00
PPDirectives.cpp To be able to replay compilations we need to accurately remodel how 2011-04-26 21:50:03 +00:00
PPExpressions.cpp Rename tok::eom to tok::eod. 2011-02-28 02:37:51 +00:00
PPLexerChange.cpp Rename tok::eom to tok::eod. 2011-02-28 02:37:51 +00:00
PPMacroExpansion.cpp Introduce __has_extension macro 2011-05-13 20:54:45 +00:00
PTHLexer.cpp fix a bunch of comment typos found by codespell. Patch by 2011-04-15 05:22:18 +00:00
Pragma.cpp To be able to replay compilations we need to accurately remodel how 2011-04-26 21:50:03 +00:00
PreprocessingRecord.cpp Introduce a new libclang parsing flag, 2011-05-06 16:33:08 +00:00
Preprocessor.cpp Introduce a new libclang parsing flag, 2011-05-06 16:33:08 +00:00
PreprocessorLexer.cpp Rename tok::eom to tok::eod. 2011-02-28 02:37:51 +00:00
ScratchBuffer.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
TokenConcatenation.cpp Introduced raw_identifier token kind. 2010-12-22 08:23:18 +00:00
TokenLexer.cpp Parsing/AST support for Structured Exception Handling 2011-04-28 01:08:34 +00:00